send-pack --keep: do not explode into loose objects on the receiving end.
[gitweb.git] / sha1_file.c
index e89d24c01595aa8ea6c6306928639b40f3313a50..278ba2f4cd05727f89be58a91a3d4efb7ac839a3 100644 (file)
@@ -1292,7 +1292,7 @@ static void *read_packed_sha1(const unsigned char *sha1, char *type, unsigned lo
        return unpack_entry(&e, type, size);
 }
 
-void * read_sha1_file(const unsigned char *sha1, char *type, unsigned long *size)
+void *read_sha1_file(const unsigned char *sha1, char *type, unsigned long *size)
 {
        unsigned long mapsize;
        void *map, *buf;
@@ -1757,7 +1757,10 @@ int has_sha1_file(const unsigned char *sha1)
 
        if (find_pack_entry(sha1, &e, NULL))
                return 1;
-       return find_sha1_file(sha1, &st) ? 1 : 0;
+       if (find_sha1_file(sha1, &st))
+               return 1;
+       reprepare_packed_git();
+       return find_pack_entry(sha1, &e, NULL);
 }
 
 /*