提交 6d4bbebd 编写于 作者: J Junio C Hamano

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: NDavid Kastrup <dak@gnu.org>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 08874658
...@@ -190,7 +190,6 @@ $1" ...@@ -190,7 +190,6 @@ $1"
;; ;;
--a|--am|--ame|--amen|--amend) --a|--am|--ame|--amen|--amend)
amend=t amend=t
log_given=t$log_given
use_commit=HEAD use_commit=HEAD
shift shift
;; ;;
...@@ -298,9 +297,9 @@ esac ...@@ -298,9 +297,9 @@ esac
case "$log_given" in case "$log_given" in
tt*) tt*)
die "Only one of -c/-C/-F/--amend can be used." ;; die "Only one of -c/-C/-F can be used." ;;
*tm*|*mt*) *tm*|*mt*)
die "Option -m cannot be combined with -c/-C/-F/--amend." ;; die "Option -m cannot be combined with -c/-C/-F." ;;
esac esac
case "$#,$also,$only,$amend" in case "$#,$also,$only,$amend" in
......
...@@ -27,7 +27,7 @@ test_expect_success \ ...@@ -27,7 +27,7 @@ test_expect_success \
test_expect_failure \ test_expect_failure \
"invalid options 1" \ "invalid options 1" \
"git-commit --amend -F file" "git-commit -m foo -m bar -F file"
test_expect_failure \ test_expect_failure \
"invalid options 2" \ "invalid options 2" \
...@@ -78,9 +78,9 @@ test_expect_success \ ...@@ -78,9 +78,9 @@ test_expect_success \
"VISUAL=./editor git-commit --amend" "VISUAL=./editor git-commit --amend"
test_expect_failure \ test_expect_failure \
"passing --amend and -F" \ "passing -m and -F" \
"echo 'enough with the bongos' >file && \ "echo 'enough with the bongos' >file && \
git-commit -F msg --amend ." git-commit -F msg -m amending ."
test_expect_success \ test_expect_success \
"using message from other commit" \ "using message from other commit" \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册