Skip to content

Commit 2b7750c

Browse files
jonathantanmygitster
authored andcommitted
sha1_file: restore OBJECT_INFO_QUICK functionality
Support for the OBJECT_INFO_QUICK flag in sha1_object_info_extended() was added in commit dfdd4af ("sha1_file: teach sha1_object_info_extended more flags", 2017-06-26) in order to support commit e83e71c ("sha1_file: refactor has_sha1_file_with_flags", 2017-06-26), but it was inadvertently removed in commit 8b4c010 ("sha1_file: support lazily fetching missing objects", 2017-12-08). Restore this functionality. Signed-off-by: Jonathan Tan <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0c16cd4 commit 2b7750c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

sha1_file.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,9 +1189,11 @@ int sha1_object_info_extended(const unsigned char *sha1, struct object_info *oi,
11891189
return 0;
11901190

11911191
/* Not a loose object; someone else may have just packed it. */
1192-
reprepare_packed_git();
1193-
if (find_pack_entry(real, &e))
1194-
break;
1192+
if (!(flags & OBJECT_INFO_QUICK)) {
1193+
reprepare_packed_git();
1194+
if (find_pack_entry(real, &e))
1195+
break;
1196+
}
11951197

11961198
/* Check if it is a missing object */
11971199
if (fetch_if_missing && repository_format_partial_clone &&

0 commit comments

Comments
 (0)