summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xgit-commit.sh4
-rw-r--r--t/t7501-commit.sh10
2 files changed, 12 insertions, 2 deletions
diff --git a/git-commit.sh b/git-commit.sh
index 6490045..959c4d6 100755
--- a/git-commit.sh
+++ b/git-commit.sh
@@ -282,9 +282,9 @@ unset only
case "$all,$interactive,$also,$#" in
*t,*t,*)
die "Cannot use -a, --interactive or -i at the same time." ;;
-t,,[1-9]*)
+t,,,[1-9]*)
die "Paths with -a does not make sense." ;;
-,t,[1-9]*)
+,t,,[1-9]*)
die "Paths with --interactive does not make sense." ;;
,,t,0)
die "No paths with -i does not make sense." ;;
diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh
index 4dc35bd..9dba104 100644
--- a/t/t7501-commit.sh
+++ b/t/t7501-commit.sh
@@ -34,6 +34,16 @@ test_expect_failure \
"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"