summaryrefslogtreecommitdiff
path: root/sha1_file.c
diff options
context:
space:
mode:
Diffstat (limited to 'sha1_file.c')
-rw-r--r--sha1_file.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sha1_file.c b/sha1_file.c
index e89d24c015..278ba2f4cd 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -1292,7 +1292,7 @@ static void *read_packed_sha1(const unsigned char *sha1, char *type, unsigned lo
return unpack_entry(&e, type, size);
}
-void * read_sha1_file(const unsigned char *sha1, char *type, unsigned long *size)
+void *read_sha1_file(const unsigned char *sha1, char *type, unsigned long *size)
{
unsigned long mapsize;
void *map, *buf;
@@ -1757,7 +1757,10 @@ int has_sha1_file(const unsigned char *sha1)
if (find_pack_entry(sha1, &e, NULL))
return 1;
- return find_sha1_file(sha1, &st) ? 1 : 0;
+ if (find_sha1_file(sha1, &st))
+ return 1;
+ reprepare_packed_git();
+ return find_pack_entry(sha1, &e, NULL);
}
/*