rerere: Fix removal of already resolved path.
There was an obvious thinko in memmove() to remove an entry that was resolved from the in-core data structure. Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano committed
Jan 4, 2007 at 00:06 UTC
3a2d3e8678a01e327c8e6c851ed6d2cfd3c21aaf
1 file changed
+3
-4
builtin-rerere.c
+3
-4
@@ -350,11 +350,10 @@ static int do_plain_rerere(struct path_list *rr, int fd)
350
fprintf(stderr, "Recorded resolution for '%s'.\n", path);
351
copy_file(path, rr_path(name, "postimage"));
352
tail_optimization:
353
- if (i < rr->nr - 1) {
353
+ if (i < rr->nr - 1)
354
memmove(rr->items + i,
355
- rr->items + i + 1,
356
- rr->nr - i - 1);
357
- }
355
+ rr->items + i + 1,
356
+ sizeof(rr->items[0]) * (rr->nr - i - 1));
357
rr->nr--;
358
i--;
359
}