提交 b419aa25 编写于 作者: B brian m. carlson 提交者: Jeff King

sha1_file: introduce has_object_file helper.

Add has_object_file, which is a wrapper around has_sha1_file, but for
struct object_id.
Signed-off-by: Nbrian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: NJeff King <peff@peff.net>
上级 0c83680e
......@@ -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
......
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册