1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-06-05 00:26:25 +02:00

Merge branch 'jk/has-sha1-file-retry-packed'

When an object is not found after checking the packfiles and then
loose object directory, read_sha1_file() re-checks the packfiles to
prevent racing with a concurrent repacker; teach the same logic to
has_sha1_file().

* jk/has-sha1-file-retry-packed:
  has_sha1_file: re-check pack directory before giving up
This commit is contained in:
Junio C Hamano 2013-09-17 11:41:34 -07:00
commit 5ff9f2351a

View File

@ -2995,7 +2995,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)