From 19378504b5f32bae8d05c27d4725d09d51a72dfd Mon Sep 17 00:00:00 2001 From: Zhao Lei Date: Wed, 23 Sep 2015 18:44:33 +0800 Subject: [PATCH] Remove quotes from subshell call in bash script Always no quotes for $() statement. We don't need quotes to hold blanks in result: # i=$(echo 1 2 3) # echo $i 1 2 3 # These quotes can make something wrong in some case: # i=$(echo '!') # # i="$(echo '!')" -bash: !: event not found # No real problem for current code, only to use a better code style. Change-Id: I3c87987d3b992c8363ef236a04ae6e35c1315535 Signed-off-by: Zhao Lei --- filter_git_history.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filter_git_history.sh b/filter_git_history.sh index 79e90aa..1336b5c 100755 --- a/filter_git_history.sh +++ b/filter_git_history.sh @@ -24,7 +24,7 @@ pruner="git ls-files | grep -v \"$keep_pattern\" | git update-index --force-remo roots="" for file in $files_to_keep; do - file_root="$(git rev-list --reverse HEAD -- $file | head -n1)" + file_root=$(git rev-list --reverse HEAD -- $file | head -n1) fail=0 for root in $roots; do if git merge-base --is-ancestor $root $file_root; then