Skip to content

Commit c65dc35

Browse files
committed
t7501: test the right kind of breakage
These tests try to run "git commit" with various "forbidden" combinations of options and expect the command to fail, but they do so without having any change added to the index. We wouldn't be able to catch breakages that would allow these combinations by mistake with them because the command will fail with "nothing to commit" anyway. Make sure we have something added to the index before running the command. Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 828ea97 commit c65dc35

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

t/t7501-commit.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,12 @@ test_expect_success 'setup: initial commit' '
3030
'
3131

3232
test_expect_success '-m and -F do not mix' '
33+
git checkout HEAD file && echo >>file && git add file &&
3334
test_must_fail git commit -m foo -m bar -F file
3435
'
3536

3637
test_expect_success '-m and -C do not mix' '
38+
git checkout HEAD file && echo >>file && git add file &&
3739
test_must_fail git commit -C HEAD -m illegal
3840
'
3941

0 commit comments

Comments
 (0)