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
This commit is contained in:
commit
b2e163272c
@ -282,9 +282,9 @@ unset only
|
|||||||
case "$all,$interactive,$also,$#" in
|
case "$all,$interactive,$also,$#" in
|
||||||
*t,*t,*)
|
*t,*t,*)
|
||||||
die "Cannot use -a, --interactive or -i at the same time." ;;
|
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." ;;
|
die "Paths with -a does not make sense." ;;
|
||||||
,t,[1-9]*)
|
,t,,[1-9]*)
|
||||||
die "Paths with --interactive does not make sense." ;;
|
die "Paths with --interactive does not make sense." ;;
|
||||||
,,t,0)
|
,,t,0)
|
||||||
die "No paths with -i does not make sense." ;;
|
die "No paths with -i does not make sense." ;;
|
||||||
|
@ -33,6 +33,16 @@ test_expect_failure \
|
|||||||
"invalid options 2" \
|
"invalid options 2" \
|
||||||
"git-commit -C HEAD -m illegal"
|
"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 \
|
test_expect_failure \
|
||||||
"using invalid commit with -C" \
|
"using invalid commit with -C" \
|
||||||
"git-commit -C bogus"
|
"git-commit -C bogus"
|
||||||
|
Loading…
Reference in New Issue
Block a user