fetch-pack: avoid repeatedly re-scanning pack directory
[gitweb.git] / builtin / fetch-pack.c
index fdda36f1497eaa971e81cc1df0fb21ada6d21120..827765dc1d87216b9c906efc8c064674d768a7ba 100644 (file)
@@ -610,6 +610,9 @@ static int everything_local(struct ref **refs, int nr_match, char **match)
        for (ref = *refs; ref; ref = ref->next) {
                struct object *o;
 
+               if (!has_sha1_file(ref->old_sha1))
+                       continue;
+
                o = parse_object(ref->old_sha1);
                if (!o)
                        continue;