sha1_file: avoid re-preparing duplicate packs
When adding packs, skip the pack if we already have it in the packed_git list. This might happen if we are re-preparing our packs because of a missing object. Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
parent
637cdd9d1d
commit
86f7780c0b
@ -617,6 +617,12 @@ static void prepare_packed_git_one(char *objdir, int local)
|
|||||||
|
|
||||||
/* we have .idx. Is it a file we can map? */
|
/* we have .idx. Is it a file we can map? */
|
||||||
strcpy(path + len, de->d_name);
|
strcpy(path + len, de->d_name);
|
||||||
|
for (p = packed_git; p; p = p->next) {
|
||||||
|
if (!memcmp(path, p->pack_name, len + namelen - 4))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (p)
|
||||||
|
continue;
|
||||||
p = add_packed_git(path, len + namelen, local);
|
p = add_packed_git(path, len + namelen, local);
|
||||||
if (!p)
|
if (!p)
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user