]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Remove quotes from subshell call in tools/split.sh
authorZhao Lei <zhaolei@cn.fujitsu.com>
Fri, 7 Aug 2015 13:17:20 +0000 (21:17 +0800)
committerZhao Lei <zhaolei@cn.fujitsu.com>
Fri, 7 Aug 2015 13:17:20 +0000 (21:17 +0800)
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 in split.sh, only to use a
better code style.

Change-Id: Ib86d59e10be0aca4774ad2fc656915a96b1b6c74
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
tools/split.sh

index 5eb7d8ece4f6fbfa31bfb4bdc9ab7890eef6041d..995d937a7428a364039d1c66eef24e4df555dd37 100755 (executable)
@@ -45,7 +45,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