From: Junio C Hamano Date: Wed, 14 Nov 2007 22:25:46 +0000 (-0800) Subject: Merge branch 'bs/maint-commit-options' X-Git-Tag: v1.5.4-rc0~204 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/b2e1632?hp=43f36901c5e4d54de2c3b7c5d62af59382df717c Merge branch 'bs/maint-commit-options' * bs/maint-commit-options: git-commit: Add tests for invalid usage of -a/--interactive with paths git-commit.sh: Fix usage checks regarding paths given when they do not make sense --- diff --git a/git-commit.sh b/git-commit.sh index 6490045d30..959c4d68e7 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 4dc35bdf55..9dba104b1f 100644 --- a/t/t7501-commit.sh +++ b/t/t7501-commit.sh @@ -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"