Skip to content

Commit 9d87442

Browse files
dotdashgitster
authored andcommitted
git-commit: Add tests for invalid usage of -a/--interactive with paths
git-commit was/is broken in that it accepts paths together with -a or --interactive, which it shouldn't. There tests check those usage errors. Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 34cb704 commit 9d87442

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

t/t7501-commit.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,16 @@ test_expect_failure \
3333
"invalid options 2" \
3434
"git-commit -C HEAD -m illegal"
3535

36+
test_expect_failure \
37+
"using paths with -a" \
38+
"echo King of the bongo >file &&
39+
git-commit -m foo -a file"
40+
41+
test_expect_failure \
42+
"using paths with --interactive" \
43+
"echo bong-o-bong >file &&
44+
echo 7 | git-commit -m foo --interactive file"
45+
3646
test_expect_failure \
3747
"using invalid commit with -C" \
3848
"git-commit -C bogus"

0 commit comments

Comments
 (0)