Skip to content

Commit

Permalink
Correct comment in prepare_packed_git_one.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Shawn O. Pearce authored and Junio C Hamano committed Feb 2, 2007
1 parent 625e942 commit 54a15a8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sha1_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -779,14 +779,17 @@ static void prepare_packed_git_one(char *objdir, int local)
if (!has_extension(de->d_name, ".idx"))
continue;

/* we have .idx. Is it a file we can map? */
/* Don't reopen a pack we already have. */
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;
/* See if it really is a valid .idx file with corresponding
* .pack file that we can map.
*/
p = add_packed_git(path, len + namelen, local);
if (!p)
continue;
Expand Down

0 comments on commit 54a15a8

Please sign in to comment.