Skip to content

Commit 7d9dd6d

Browse files
committed
Merge branch 'jk/has-sha1-file-retry-packed' into maint
* jk/has-sha1-file-retry-packed: has_sha1_file: re-check pack directory before giving up
2 parents 87b24a4 + 45e8a74 commit 7d9dd6d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sha1_file.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2925,7 +2925,10 @@ int has_sha1_file(const unsigned char *sha1)
29252925

29262926
if (find_pack_entry(sha1, &e))
29272927
return 1;
2928-
return has_loose_object(sha1);
2928+
if (has_loose_object(sha1))
2929+
return 1;
2930+
reprepare_packed_git();
2931+
return find_pack_entry(sha1, &e);
29292932
}
29302933

29312934
static void check_tree(const void *buf, size_t size)

0 commit comments

Comments
 (0)