From 6d4bbebd35e3a6e8091d7188f1c4d49af7f054e3 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 1 Aug 2007 18:14:41 -0700 Subject: [PATCH] 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 Signed-off-by: Junio C Hamano --- git-commit.sh | 5 ++--- t/t7501-commit.sh | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/git-commit.sh b/git-commit.sh index 4290ae2dd..d7e7028c1 100755 --- a/git-commit.sh +++ b/git-commit.sh @@ -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 diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh index 8cc2cd9e6..6bd3c9e3e 100644 --- a/t/t7501-commit.sh +++ b/t/t7501-commit.sh @@ -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" \ -- 2.30.2