summaryrefslogtreecommitdiff
path: root/merge-recursive.c
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2006-08-04 18:21:41 +0200
committerJunio C Hamano <junkio@cox.net>2006-08-04 11:30:35 -0700
commit3d234d0afacd355eb30b330a56bd2efa73bd44d5 (patch)
treec5c37ecda8675bc1c8741a17b7abec07ab9c6bc0 /merge-recursive.c
parentc8b87ef8b0da6b08a19ed4f98eb58f46748af1e9 (diff)
downloadgit-3d234d0afacd355eb30b330a56bd2efa73bd44d5.tar.gz
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: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'merge-recursive.c')
-rw-r--r--merge-recursive.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/merge-recursive.c b/merge-recursive.c
index 74a329faa5..f5c0080a51 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -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 */