{"thread":{"id":"5123","subject":"[PATCH] merge-recursive: fix rename handling","startedAt":"2006-08-04T16:21:41Z","lastAt":"2006-08-04T16:21:41Z","messageCount":1,"participants":["Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"24716","messageId":"Pine.LNX.4.63.0608041821040.1800@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"5123","inReplyTo":null,"subject":"[PATCH] merge-recursive: fix rename handling","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-08-04T16:21:41Z","receivedAt":"2006-08-04T16:21:41Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nTo handle renames properly, we iterate through all file names of both\nheads, the current one, and the one to be merged.\n\nOnly that there was a bug, where it was checked if the file name was present\nin both heads, but the result of the check was never used. Instead, the\nmerge proceeded as if both heads contained that file.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n merge-recursive.c |    6 ++++--\n 1 files changed, 4 insertions(+), 2 deletions(-)\n\ndiff --git a/merge-recursive.c b/merge-recursive.c\nindex 10bce70..1e176ca 100644\n--- a/merge-recursive.c\n+++ b/merge-recursive.c\n@@ -808,8 +808,10 @@ static int process_renames(struct path_l\n \t\t} else {\n \t\t\tcompare = strcmp(a_renames->items[i].path,\n \t\t\t\t\tb_renames->items[j].path);\n-\t\t\tren1 = a_renames->items[i++].util;\n-\t\t\tren2 = b_renames->items[j++].util;\n+\t\t\tif (compare <= 0)\n+\t\t\t\tren1 = a_renames->items[i++].util;\n+\t\t\tif (compare >= 0)\n+\t\t\t\tren2 = b_renames->items[j++].util;\n \t\t}\n \n \t\t/* TODO: refactor, so that 1/2 are not needed */\n-- \n1.4.2.rc2.ga8a2\n"}]}