git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Charles Bailey <charles@hashpling.org>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Junio C Hamano <gitster@pobox.com>,
	git@vger.kernel.org
Cc: Charles Bailey <charles@hashpling.org>
Subject: [PATCH 1/2] merge-file fails to output anything for a degenerate merge
Date: Mon, 25 May 2009 01:21:13 +0100	[thread overview]
Message-ID: <1243210874-18451-2-git-send-email-charles@hashpling.org> (raw)
In-Reply-To: <1243210874-18451-1-git-send-email-charles@hashpling.org>

In the case that merge-file is passed three files with identical
contents it wipes the contents of the output file instead of
leaving it unchanged.

Althought merge-file is porcelain and this will never happen in
normal usage, it is still wrong.

Signed-off-by: Charles Bailey <charles@hashpling.org>
---
 t/t6023-merge-file.sh |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/t/t6023-merge-file.sh b/t/t6023-merge-file.sh
index f8942bc..44141af 100755
--- a/t/t6023-merge-file.sh
+++ b/t/t6023-merge-file.sh
@@ -54,6 +54,11 @@ deduxit me super semitas jusitiae,
 EOF
 printf "propter nomen suum." >> new4.txt
 
+cp orig.txt test.txt
+test_expect_success "merge with no changes" \
+	"git merge-file test.txt orig.txt orig.txt &&
+	 test_cmp test.txt orig.txt"
+
 cp new1.txt test.txt
 test_expect_success "merge without conflict" \
 	"git merge-file test.txt orig.txt new2.txt"
-- 
1.6.3.1.72.gbd1ec

  reply	other threads:[~2009-05-25  0:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-25  0:21 Slightly obscure merge-file inconsistency Charles Bailey
2009-05-25  0:21 ` Charles Bailey [this message]
2009-05-25  0:21   ` [PATCH 2/2] Change xdl_merge to generate output even for null merges Charles Bailey
2009-05-25  7:51     ` Johannes Schindelin
2009-05-25  7:52   ` [PATCH 1/2] merge-file fails to output anything for a degenerate merge Johannes Schindelin

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=1243210874-18451-2-git-send-email-charles@hashpling.org \
    --to=charles@hashpling.org \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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).