Skip to content

Commit 8af69cf

Browse files
sgngitster
authored andcommitted
t3301: test diagnose messages for too few/many paramters
Commit bbb1b8a ("notes: check number of parameters to "git notes copy"", 2010-06-28) added a test for too many or too few of parameters provided to `git notes copy'. However, the test only ensures that the command will fail but it doesn't really check if it fails because of number of parameters. If we accidentally lifted the check inside our code base, the test may still have failed because the provided parameter is not a valid ref. Correct it. Signed-off-by: Doan Tran Cong Danh <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 108b97d commit 8af69cf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

t/t3301-notes.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,8 +1167,10 @@ test_expect_success 'GIT_NOTES_REWRITE_REF overrides config' '
11671167
'
11681168

11691169
test_expect_success 'git notes copy diagnoses too many or too few parameters' '
1170-
test_must_fail git notes copy &&
1171-
test_must_fail git notes copy one two three
1170+
test_must_fail git notes copy 2>error &&
1171+
test_i18ngrep "too few parameters" error &&
1172+
test_must_fail git notes copy one two three 2>error &&
1173+
test_i18ngrep "too many parameters" error
11721174
'
11731175

11741176
test_expect_success 'git notes get-ref expands refs/heads/master to refs/notes/refs/heads/master' '

0 commit comments

Comments
 (0)