git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/2] merge-file fails to output anything for a degenerate merge

From
Charles Bailey <charles@hashpling.org>
Date
May 25, 2009, 00:21 UTC
Message-ID
<1243210874-18451-2-git-send-email-charles@hashpling.org>
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
Previous: Charles BaileyNext: Charles Bailey
Message 2 of 5 in “Slightly obscure merge-file inconsistency”
  1. Charles BaileyMay 25, 2009
  2. 1/2 merge-file fails to output anything for a degenerate mergeCharles Bailey, May 25, 2009
  3. 2/2 Change xdl_merge to generate output even for null mergesCharles Bailey, May 25, 2009
  4. Johannes SchindelinMay 25, 2009
  5. Johannes SchindelinMay 25, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.