Skip to content

Commit 23ce5c3

Browse files
j6tgitster
authored andcommitted
t3900: do not reference numbered arguments from the test script
The call to test_expect_success is nested inside a function, whose arguments the test code wants to access. But it is not specified that any unexpanded $1, $2, $3, etc in the test code will access the surrounding function's arguments. Rather, they will access the arguments of the function that happens to eval the test code. In this case, the reference is intended to supply '-m message' to a call of 'git commit --squash'. Remove it because -m is optional and the test case does not check for it. There are tests in t7500 that check combinations of --squash and -m. Signed-off-by: Johannes Sixt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a7c58f2 commit 23ce5c3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

t/t3900-i18n-commit.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ test_commit_autosquash_flags () {
147147
git commit -a -m "intermediate commit" &&
148148
test_tick &&
149149
echo $H $flag >>F &&
150-
git commit -a --$flag HEAD~1 $3 &&
150+
git commit -a --$flag HEAD~1 &&
151151
E=$(git cat-file commit '$H-$flag' |
152152
sed -ne "s/^encoding //p") &&
153153
test "z$E" = "z$H" &&
@@ -160,6 +160,6 @@ test_commit_autosquash_flags () {
160160

161161
test_commit_autosquash_flags eucJP fixup
162162

163-
test_commit_autosquash_flags ISO-2022-JP squash '-m "squash message"'
163+
test_commit_autosquash_flags ISO-2022-JP squash
164164

165165
test_done

0 commit comments

Comments
 (0)