Skip to content

Commit

Permalink
git-commit: Add tests for invalid usage of -a/--interactive with paths
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Björn Steinbrink authored and Junio C Hamano committed Nov 13, 2007
1 parent 34cb704 commit 9d87442
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions t/t7501-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@ test_expect_failure \
"invalid options 2" \
"git-commit -C HEAD -m illegal"

test_expect_failure \
"using paths with -a" \
"echo King of the bongo >file &&
git-commit -m foo -a file"

test_expect_failure \
"using paths with --interactive" \
"echo bong-o-bong >file &&
echo 7 | git-commit -m foo --interactive file"

test_expect_failure \
"using invalid commit with -C" \
"git-commit -C bogus"
Expand Down

0 comments on commit 9d87442

Please sign in to comment.