Correct comment in prepare_packed_git_one.
After staring at the comment and the associated for loop, I realized the comment was completely bogus. The section of code its talking about is trying to avoid duplicate mapping of the same packfile. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Shawn O. Pearce committed
Feb 1, 2007 at 15:52 UTC
54a15a8df269315adf7110a87391bd5bef7e90f0
1 file changed
+4
-1
sha1_file.c
+4
-1
@@ -779,7 +779,7 @@ static void prepare_packed_git_one(char *objdir, int local)
779
if (!has_extension(de->d_name, ".idx"))
780
continue;
781
782
- /* we have .idx. Is it a file we can map? */
782
+ /* Don't reopen a pack we already have. */
783
strcpy(path + len, de->d_name);
784
for (p = packed_git; p; p = p->next) {
785
if (!memcmp(path, p->pack_name, len + namelen - 4))
@@ -787,6 +787,9 @@ static void prepare_packed_git_one(char *objdir, int local)
787
}
788
if (p)
789
continue;
790
+ /* See if it really is a valid .idx file with corresponding
791
+ * .pack file that we can map.
792
+ */
793
p = add_packed_git(path, len + namelen, local);
794
if (!p)
795
continue;