@matheusbsbs / matheus-bagliano / commits / 6d4bbebd35
Fork 0

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>

Junio C Hamano committed Aug 1, 2007 at 18:14 UTC 6d4bbebd35e3a6e8091d7188f1c4d49af7f054e3
2 files changed +5 -6
git-commit.sh
+2 -3
@@ -190,7 +190,6 @@ $1"
190 ;;
191 --a|--am|--ame|--amen|--amend)
192 amend=t
193 - log_given=t$log_given
193 use_commit=HEAD
194 shift
195 ;;
@@ -298,9 +297,9 @@ esac
297
298 case "$log_given" in
299 tt*)
301 - die "Only one of -c/-C/-F/--amend can be used." ;;
300 + die "Only one of -c/-C/-F can be used." ;;
301 *tm*|*mt*)
303 - die "Option -m cannot be combined with -c/-C/-F/--amend." ;;
302 + die "Option -m cannot be combined with -c/-C/-F." ;;
303 esac
304
305 case "$#,$also,$only,$amend" in
t/t7501-commit.sh
+3 -3
@@ -27,7 +27,7 @@ test_expect_success \
27
28 test_expect_failure \
29 "invalid options 1" \
30 - "git-commit --amend -F file"
30 + "git-commit -m foo -m bar -F file"
31
32 test_expect_failure \
33 "invalid options 2" \
@@ -78,9 +78,9 @@ test_expect_success \
78 "VISUAL=./editor git-commit --amend"
79
80 test_expect_failure \
81 - "passing --amend and -F" \
81 + "passing -m and -F" \
82 "echo 'enough with the bongos' >file && \
83 - git-commit -F msg --amend ."
83 + git-commit -F msg -m amending ."
84
85 test_expect_success \
86 "using message from other commit" \