Skip to content

Commit

Permalink
rerere: Fix removal of already resolved path.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Jan 5, 2007
1 parent e27e609 commit 3a2d3e8
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions builtin-rerere.c
Original file line number Diff line number Diff line change
Expand Up @@ -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--;
}
Expand Down

0 comments on commit 3a2d3e8

Please sign in to comment.