Skip to content

Commit 54a15a8

Browse files
spearceJunio C Hamano
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 625e942 commit 54a15a8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sha1_file.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -779,14 +779,17 @@ static void prepare_packed_git_one(char *objdir, int local)
779779
if (!has_extension(de->d_name, ".idx"))
780780
continue;
781781

782-
/* we have .idx. Is it a file we can map? */
782+
/* Don't reopen a pack we already have. */
783783
strcpy(path + len, de->d_name);
784784
for (p = packed_git; p; p = p->next) {
785785
if (!memcmp(path, p->pack_name, len + namelen - 4))
786786
break;
787787
}
788788
if (p)
789789
continue;
790+
/* See if it really is a valid .idx file with corresponding
791+
* .pack file that we can map.
792+
*/
790793
p = add_packed_git(path, len + namelen, local);
791794
if (!p)
792795
continue;

0 commit comments

Comments
 (0)