Skip to content

Commit

Permalink
t3900: do not reference numbered arguments from the test script
Browse files Browse the repository at this point in the history
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 <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Johannes Sixt authored and Junio C Hamano committed Aug 11, 2011
1 parent a7c58f2 commit 23ce5c3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions t/t3900-i18n-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ test_commit_autosquash_flags () {
git commit -a -m "intermediate commit" &&
test_tick &&
echo $H $flag >>F &&
git commit -a --$flag HEAD~1 $3 &&
git commit -a --$flag HEAD~1 &&
E=$(git cat-file commit '$H-$flag' |
sed -ne "s/^encoding //p") &&
test "z$E" = "z$H" &&
Expand All @@ -160,6 +160,6 @@ test_commit_autosquash_flags () {

test_commit_autosquash_flags eucJP fixup

test_commit_autosquash_flags ISO-2022-JP squash '-m "squash message"'
test_commit_autosquash_flags ISO-2022-JP squash

test_done

0 comments on commit 23ce5c3

Please sign in to comment.