DORMANTno replies

[PATCH] merge-recursive: fix rename handling

From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:42:35
Subsystem: the rest · Maintainer: Linus Torvalds

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 <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help