Skip to content

Commit 2ee13eb

Browse files
committed
test_git.sh: quote literal {}
Fixes SC1083. Part of #891.
1 parent 99d693d commit 2ee13eb

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

test_git.sh

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -631,9 +631,9 @@ function git::rev_parse_branch() {
631631
SHA2="$(git rev-parse HEAD)"
632632

633633
assert_eq "$(git rev-parse branch_1)" "$SHA1"
634-
assert_eq "$(git rev-parse branch_1^{commit})" "$SHA1"
634+
assert_eq "$(git rev-parse 'branch_1^{commit}')" "$SHA1"
635635
assert_eq "$(git rev-parse branch_2)" "$SHA2"
636-
assert_eq "$(git rev-parse branch_2^{commit})" "$SHA2"
636+
assert_eq "$(git rev-parse 'branch_2^{commit}')" "$SHA2"
637637
}
638638

639639
##############################################
@@ -675,13 +675,13 @@ function git::rev_parse_tag() {
675675
git tag tag_4
676676

677677
assert_eq "$(git rev-parse tag_1)" "$SHA1"
678-
assert_eq "$(git rev-parse tag_1^{commit})" "$SHA1"
678+
assert_eq "$(git rev-parse 'tag_1^{commit}')" "$SHA1"
679679
assert_eq "$(git rev-parse tag_2)" "$SHA2"
680-
assert_eq "$(git rev-parse tag_2^{commit})" "$SHA2"
680+
assert_eq "$(git rev-parse 'tag_2^{commit}')" "$SHA2"
681681
assert_eq "$(git rev-parse tag_3)" "$SHA3"
682-
assert_eq "$(git rev-parse tag_3^{commit})" "$SHA3"
682+
assert_eq "$(git rev-parse 'tag_3^{commit}')" "$SHA3"
683683
assert_eq "$(git rev-parse tag_4)" "$SHA4"
684-
assert_eq "$(git rev-parse tag_4^{commit})" "$SHA4"
684+
assert_eq "$(git rev-parse 'tag_4^{commit}')" "$SHA4"
685685
}
686686

687687
##############################################
@@ -724,10 +724,10 @@ function git::rev_parse_tag_annotated() {
724724

725725
# Annotated tags have their own SHA, which can be found with rev-parse, but
726726
# it doesn't make sense to test rev-parse against itself.
727-
assert_eq "$(git rev-parse anntag_1^{commit})" "$SHA1"
728-
assert_eq "$(git rev-parse anntag_2^{commit})" "$SHA2"
729-
assert_eq "$(git rev-parse anntag_3^{commit})" "$SHA3"
730-
assert_eq "$(git rev-parse anntag_4^{commit})" "$SHA4"
727+
assert_eq "$(git rev-parse 'anntag_1^{commit}')" "$SHA1"
728+
assert_eq "$(git rev-parse 'anntag_2^{commit}')" "$SHA2"
729+
assert_eq "$(git rev-parse 'anntag_3^{commit}')" "$SHA3"
730+
assert_eq "$(git rev-parse 'anntag_4^{commit}')" "$SHA4"
731731
}
732732

733733
##############################################
@@ -804,10 +804,10 @@ function git::rev_parse_non_existent_sha() {
804804
# As long as it tastes like a SHA, rev-parse is happy, but there is no
805805
# commit for it.
806806
assert_eq "$(git rev-parse 0123456789abcdef0123456789abcdef01234567)" "0123456789abcdef0123456789abcdef01234567"
807-
assert_substr "$(git rev-parse 0123456789abcdef0123456789abcdef01234567^{commit} 2>&1 || true)" "unknown revision"
807+
assert_substr "$(git rev-parse '0123456789abcdef0123456789abcdef01234567^{commit}' 2>&1 || true)" "unknown revision"
808808
# Less-than-full SHAs do not work.
809809
assert_substr "$(git rev-parse 0123456789abcdef 2>&1 || true)" "unknown revision"
810-
assert_substr "$(git rev-parse 0123456789abcdef^{commit} 2>&1 || true)" "unknown revision"
810+
assert_substr "$(git rev-parse '0123456789abcdef^{commit}' 2>&1 || true)" "unknown revision"
811811
}
812812

813813
#

0 commit comments

Comments
 (0)