Skip to content

Commit 587ac8c

Browse files
peffgitster
authored andcommitted
t7501.8: feed a meaningful command
The command expects "git commit --interactive <path>" to fail because you cannot (yet) limit "commit --interactive" with a pathspec, but even if the command allowed to take <path>, the test would have failed as saying just 7:quit would leave the index the same as the current commit, leading to an attempt to create an empty commit that would fail without --allow-empty. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1020d08 commit 587ac8c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

t/t7501-commit.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,12 @@ test_expect_success \
4141
"echo King of the bongo >file &&
4242
test_must_fail git commit -m foo -a file"
4343

44-
test_expect_success PERL \
45-
"using paths with --interactive" \
46-
"echo bong-o-bong >file &&
47-
! (echo 7 | git commit -m foo --interactive file)"
44+
test_expect_success PERL 'cannot use paths with --interactive' '
45+
echo bong-o-bong >file &&
46+
# 2: update, 1:st path, that is all, 7: quit
47+
( echo 2; echo 1; echo; echo 7 ) |
48+
test_must_fail git commit -m foo --interactive file
49+
'
4850

4951
test_expect_success \
5052
"using invalid commit with -C" \

0 commit comments

Comments
 (0)