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

[PATCH] merge-recursive: fix rename handling

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Aug 4, 2006, 16:21 UTC
Message-ID
<Pine.LNX.4.63.0608041821040.1800@wbgn013.biozentrum.uni-wuerzburg.de>

To handle renames properly, we iterate through all file names of both heads, the current one, and the one to be merged.

Only that there was a bug, where it was checked if the file name was present in both heads, but the result of the check was never used. Instead, the merge proceeded as if both heads contained that file.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 merge-recursive.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/merge-recursive.c b/merge-recursive.c
index 10bce70..1e176ca 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -808,8 +808,10 @@ static int process_renames(struct path_l
 		} else {
 			compare = strcmp(a_renames->items[i].path,
 					b_renames->items[j].path);
-			ren1 = a_renames->items[i++].util;
-			ren2 = b_renames->items[j++].util;
+			if (compare <= 0)
+				ren1 = a_renames->items[i++].util;
+			if (compare >= 0)
+				ren2 = b_renames->items[j++].util;
 		}
 
 		/* TODO: refactor, so that 1/2 are not needed */
-- 
1.4.2.rc2.ga8a2
Message 1 of 1 in “merge-recursive: fix rename handling”
  1. merge-recursive: fix rename handlingJohannes Schindelin, Aug 4, 2006

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.