aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2006-06-02 12:49:32 -0400
committerJunio C Hamano <junkio@cox.net>2006-06-02 11:09:44 -0700
commit86f7780c0b77b3c162f85d499189f9d1f0b296df (patch)
treea6199829b146d7f5c45dbf7621216cf31495e87c
parent637cdd9d1d997fca34a1fc668fed1311e30fe95f (diff)
downloadgit-86f7780c0b77b3c162f85d499189f9d1f0b296df.tar.gz
git-86f7780c0b77b3c162f85d499189f9d1f0b296df.tar.xz
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>
-rw-r--r--sha1_file.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sha1_file.c b/sha1_file.c
index 696e53f1c..aea0f40d5 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -617,6 +617,12 @@ static void prepare_packed_git_one(char *objdir, int local)
/* we have .idx. Is it a file we can map? */
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);
if (!p)
continue;