From: Junio C Hamano Date: Mon, 2 Jul 2007 23:41:44 +0000 (-0700) Subject: Merge branch 'maint' X-Git-Tag: v1.5.3-rc0~10 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b941ffac506d3f57246e46a8913da614e62a1d48;p=git.git Merge branch 'maint' * maint: Make git-prune submodule aware (and fix a SEGFAULT in the process) --- b941ffac506d3f57246e46a8913da614e62a1d48 diff --cc reachable.c index ff3dd3496,c1aee603e..6383401e2 --- a/reachable.c +++ b/reachable.c @@@ -47,6 -55,8 +55,8 @@@ static void process_tree(struct tree *t while (tree_entry(&desc, &entry)) { if (S_ISDIR(entry.mode)) process_tree(lookup_tree(entry.sha1), p, &me, entry.path); - else if (S_ISDIRLNK(entry.mode)) ++ else if (S_ISGITLINK(entry.mode)) + process_gitlink(entry.sha1, p, &me, entry.path); else process_blob(lookup_blob(entry.sha1), p, &me, entry.path); } @@@ -159,6 -169,16 +169,16 @@@ static void add_cache_refs(struct rev_i read_cache(); for (i = 0; i < active_nr; i++) { + /* + * The index can contain blobs and GITLINKs, GITLINKs are hashes + * that don't actually point to objects in the repository, it's + * almost guaranteed that they are NOT blobs, so we don't call + * lookup_blob() on them, to avoid populating the hash table + * with invalid information + */ - if (S_ISDIRLNK(ntohl(active_cache[i]->ce_mode))) ++ if (S_ISGITLINK(ntohl(active_cache[i]->ce_mode))) + continue; + lookup_blob(active_cache[i]->sha1); /* * We could add the blobs to the pending list, but quite