diff options
Diffstat (limited to 'test/lint/git-subtree-check.sh')
-rwxr-xr-x | test/lint/git-subtree-check.sh | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/test/lint/git-subtree-check.sh b/test/lint/git-subtree-check.sh index 3556e49e08..cdaa5752ac 100755 --- a/test/lint/git-subtree-check.sh +++ b/test/lint/git-subtree-check.sh @@ -82,6 +82,7 @@ if [ -z "$latest_squash" ]; then echo "ERROR: $DIR is not a subtree" >&2 exit 2 fi +# shellcheck disable=SC2086 set $latest_squash old=$1 rev=$2 @@ -92,6 +93,7 @@ if [ -z "$tree_actual" ]; then echo "FAIL: subtree directory $DIR not found in $COMMIT" >&2 exit 1 fi +# shellcheck disable=SC2086 set $tree_actual tree_actual_type=$2 tree_actual_tree=$3 @@ -102,23 +104,23 @@ if [ "d$tree_actual_type" != "dtree" ]; then fi # get the tree at the time of the last subtree update -tree_commit=$(git show -s --format="%T" $old) +tree_commit=$(git show -s --format="%T" "$old") echo "$DIR in $COMMIT was last updated in commit $old (tree $tree_commit)" # ... and compare the actual tree with it if [ "$tree_actual_tree" != "$tree_commit" ]; then - git diff $tree_commit $tree_actual_tree >&2 + git diff "$tree_commit" "$tree_actual_tree" >&2 echo "FAIL: subtree directory was touched without subtree merge" >&2 exit 1 fi if [ "$check_remote" != "0" ]; then # get the tree in the subtree commit referred to - if [ "d$(git cat-file -t $rev 2>/dev/null)" != dcommit ]; then + if [ "d$(git cat-file -t "$rev" 2>/dev/null)" != dcommit ]; then echo "subtree commit $rev unavailable: cannot compare. Did you add and fetch the remote?" >&2 exit 1 fi - tree_subtree=$(git show -s --format="%T" $rev) + tree_subtree=$(git show -s --format="%T" "$rev") echo "$DIR in $COMMIT was last updated to upstream commit $rev (tree $tree_subtree)" # ... and compare the actual tree with it |