提交 3d234d0a 编写于 作者: J Johannes Schindelin 提交者: Junio C Hamano

merge-recursive: fix rename handling

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: NJohannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: NJunio C Hamano <junkio@cox.net>
上级 c8b87ef8
......@@ -810,8 +810,10 @@ static int process_renames(struct path_list *a_renames,
} 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 */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册