1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-06-01 20:36:33 +02:00

git-commit.sh: Permit the --amend message to be given with -m/-c/-C/-F.

[jc: adjusted t/t7501 as this makes -F and --amend compatible]

Signed-off-by: David Kastrup <dak@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Junio C Hamano 2007-08-01 18:14:41 -07:00
parent 08874658b4
commit 6d4bbebd35
2 changed files with 5 additions and 6 deletions

View File

@ -190,7 +190,6 @@ $1"
;;
--a|--am|--ame|--amen|--amend)
amend=t
log_given=t$log_given
use_commit=HEAD
shift
;;
@ -298,9 +297,9 @@ esac
case "$log_given" in
tt*)
die "Only one of -c/-C/-F/--amend can be used." ;;
die "Only one of -c/-C/-F can be used." ;;
*tm*|*mt*)
die "Option -m cannot be combined with -c/-C/-F/--amend." ;;
die "Option -m cannot be combined with -c/-C/-F." ;;
esac
case "$#,$also,$only,$amend" in

View File

@ -27,7 +27,7 @@ test_expect_success \
test_expect_failure \
"invalid options 1" \
"git-commit --amend -F file"
"git-commit -m foo -m bar -F file"
test_expect_failure \
"invalid options 2" \
@ -78,9 +78,9 @@ test_expect_success \
"VISUAL=./editor git-commit --amend"
test_expect_failure \
"passing --amend and -F" \
"passing -m and -F" \
"echo 'enough with the bongos' >file && \
git-commit -F msg --amend ."
git-commit -F msg -m amending ."
test_expect_success \
"using message from other commit" \