Merge branch 'ti/fetch-everything-local-optim'
[gitweb.git] / sha1_file.c
index 1b94f39c4c5653b090d5dbecf0cf7a785b0556bb..ad775495659ee09cf287965f2f7b3044bb1b04e2 100644 (file)
@@ -1262,14 +1262,19 @@ int sha1_object_info_extended(const unsigned char *sha1, struct object_info *oi,
                if (find_pack_entry(real, &e))
                        break;
 
+               if (flags & OBJECT_INFO_IGNORE_LOOSE)
+                       return -1;
+
                /* Most likely it's a loose object. */
                if (!sha1_loose_object_info(real, oi, flags))
                        return 0;
 
                /* Not a loose object; someone else may have just packed it. */
-               reprepare_packed_git();
-               if (find_pack_entry(real, &e))
-                       break;
+               if (!(flags & OBJECT_INFO_QUICK)) {
+                       reprepare_packed_git();
+                       if (find_pack_entry(real, &e))
+                               break;
+               }
 
                /* Check if it is a missing object */
                if (fetch_if_missing && repository_format_partial_clone &&