aboutsummaryrefslogtreecommitdiff
path: root/test/lint/git-subtree-check.sh
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2021-11-07 14:13:39 +0200
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2021-11-13 16:54:56 +0200
commit9a1ad7bc0dd8a0769738ca4dffbeb8d55438b0dc (patch)
treeeb2ec6cb2b8dd61d246e0e077b875afe445044d0 /test/lint/git-subtree-check.sh
parent5cc083cd46ad71510f56af957e2e8733c388c6f1 (diff)
downloadbitcoin-9a1ad7bc0dd8a0769738ca4dffbeb8d55438b0dc.tar.xz
test: Enable SC2086 shellcheck rule
Diffstat (limited to 'test/lint/git-subtree-check.sh')
-rwxr-xr-xtest/lint/git-subtree-check.sh10
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