aboutsummaryrefslogtreecommitdiff
path: root/builtin-rerere.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2007-01-04 00:06:50 -0800
committerJunio C Hamano <junkio@cox.net>2007-01-04 22:28:46 -0800
commit3a2d3e8678a01e327c8e6c851ed6d2cfd3c21aaf (patch)
tree1074afaacfb11469a3dbbb653cc433444f91b319 /builtin-rerere.c
parente27e609bbf81271318d99f2643f378f3fde6c6c6 (diff)
downloadgit-3a2d3e8678a01e327c8e6c851ed6d2cfd3c21aaf.tar.gz
git-3a2d3e8678a01e327c8e6c851ed6d2cfd3c21aaf.tar.xz
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>
Diffstat (limited to 'builtin-rerere.c')
-rw-r--r--builtin-rerere.c7
1 files changed, 3 insertions, 4 deletions
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--;
}