From: Junio C Hamano Date: Thu, 4 Jan 2007 08:06:50 +0000 (-0800) Subject: rerere: Fix removal of already resolved path. X-Git-Tag: v1.5.0-rc1~95 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3a2d3e8678a01e327c8e6c851ed6d2cfd3c21aaf;p=git.git 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 --- diff --git a/builtin-rerere.c b/builtin-rerere.c index 7442498de..079c0bdf3 100644 --- a/builtin-rerere.c +++ b/builtin-rerere.c @@ -350,11 +350,10 @@ static int do_plain_rerere(struct path_list *rr, int fd) fprintf(stderr, "Recorded resolution for '%s'.\n", path); copy_file(path, rr_path(name, "postimage")); tail_optimization: - if (i < rr->nr - 1) { + if (i < rr->nr - 1) memmove(rr->items + i, - rr->items + i + 1, - rr->nr - i - 1); - } + rr->items + i + 1, + sizeof(rr->items[0]) * (rr->nr - i - 1)); rr->nr--; i--; }