Commits

Junio C Hamano  committed 6d4bbeb

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>

  • Participants
  • Parent commits 0887465

Comments (0)

Files changed (2)

File git-commit.sh

 		;;
 	--a|--am|--ame|--amen|--amend)
 		amend=t
-		log_given=t$log_given
 		use_commit=HEAD
 		shift
 		;;
 
 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

File t/t7501-commit.sh

 
 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" \
 	"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" \