From: Junio C Hamano <gitster@pobox.com>
To: Johannes Sixt <johannes.sixt@telecom.at>
Cc: krh@redhat.com, Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH] git-commit: Allow to amend a merge commit that does not change the tree
Date: Mon, 03 Dec 2007 00:26:21 -0800 [thread overview]
Message-ID: <7vir3gmbf6.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <7vtzn0md0h.fsf@gitster.siamese.dyndns.org> (Junio C. Hamano's message of "Sun, 02 Dec 2007 23:51:58 -0800")
Will roll in this as a new test.
--
t/t7501-commit.sh | 32 ++++++++++++++++++++++++++++++++
1 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh
index 31a6f63..2e7bcb0 100755
--- a/t/t7501-commit.sh
+++ b/t/t7501-commit.sh
@@ -244,4 +244,36 @@ test_expect_success 'multiple -m' '
'
+test_expect_success 'same tree (single parent)' '
+
+ if git commit -m empty
+ then
+ echo oops -- should have complained
+ false
+ else
+ : happy
+ fi
+
+'
+
+test_expect_success 'same tree (merge and amend merge)' '
+
+ git checkout -b side HEAD^ &&
+ echo zero >zero &&
+ git add zero &&
+ git commit -m "add zero" &&
+ git checkout master &&
+
+ git merge -s ours side -m "empty ok" &&
+ git diff HEAD^ HEAD >actual &&
+ : >expected &&
+ diff -u expected actual &&
+
+ git commit --amend -m "empty really ok" &&
+ git diff HEAD^ HEAD >actual &&
+ : >expected &&
+ diff -u expected actual
+
+'
+
test_done
--
1.5.3.7-2077-ga07a
prev parent reply other threads:[~2007-12-03 8:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-03 7:24 [PATCH] git-commit: Allow to amend a merge commit that does not change the tree Johannes Sixt
2007-12-03 7:51 ` Junio C Hamano
2007-12-03 8:26 ` Junio C Hamano [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vir3gmbf6.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=johannes.sixt@telecom.at \
--cc=krh@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).