Clear the delta base cache during fast-import checkpoint

Otherwise we may reuse the same memory address for a totally
different "struct packed_git", and a previously cached object from
the prior occupant might be returned when trying to unpack an object
from the new pack.

Found-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Shawn O. Pearce
2009-02-10 13:36:12 -08:00
committed by Junio C Hamano
parent ab2fdb3b62
commit 3d20c636af
3 changed files with 9 additions and 0 deletions

View File

@ -943,6 +943,7 @@ static void end_packfile(void)
{
struct packed_git *old_p = pack_data, *new_p;
clear_delta_base_cache();
if (object_count) {
char *idx_name;
int i;