diff options
-rw-r--r-- | cache.h | 3 | ||||
-rw-r--r-- | sha1_file.c | 5 |
2 files changed, 8 insertions, 0 deletions
@@ -1030,6 +1030,9 @@ static inline int has_sha1_file(const unsigned char *sha1) return has_sha1_file_with_flags(sha1, 0); } +/* Same as the above, except for struct object_id. */ +extern int has_object_file(const struct object_id *oid); + /* * Return true iff an alternate object database has a loose object * with the specified name. This function does not respect replace diff --git a/sha1_file.c b/sha1_file.c index 3d56746a9b..27ce7b705e 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -3216,6 +3216,11 @@ int has_sha1_file_with_flags(const unsigned char *sha1, int flags) return find_pack_entry(sha1, &e); } +int has_object_file(const struct object_id *oid) +{ + return has_sha1_file(oid->hash); +} + static void check_tree(const void *buf, size_t size) { struct tree_desc desc; |