Documentation/rev-list-options.txt: fix some grammatical issues and typos
[gitweb.git] / sha1_file.c
index 8e27db1bd2b49f28b235fcd7e18a0dda43a1f045..613839db544dc852ee49d026bb1b561e6e1ce4bf 100644 (file)
@@ -2444,7 +2444,6 @@ static int sha1_loose_object_info(const unsigned char *sha1,
        return 0;
 }
 
-/* returns enum object_type or negative */
 int sha1_object_info_extended(const unsigned char *sha1, struct object_info *oi)
 {
        struct cached_object *co;
@@ -2493,6 +2492,7 @@ int sha1_object_info_extended(const unsigned char *sha1, struct object_info *oi)
        return 0;
 }
 
+/* returns enum object_type or negative */
 int sha1_object_info(const unsigned char *sha1, unsigned long *sizep)
 {
        enum object_type type;
@@ -2925,7 +2925,10 @@ int has_sha1_file(const unsigned char *sha1)
 
        if (find_pack_entry(sha1, &e))
                return 1;
-       return has_loose_object(sha1);
+       if (has_loose_object(sha1))
+               return 1;
+       reprepare_packed_git();
+       return find_pack_entry(sha1, &e);
 }
 
 static void check_tree(const void *buf, size_t size)