提交 dade09c2 编写于 作者: L Linus Torvalds

Add "has_sha1_pack()" function to query whether the object is available in a pack

We'll want this for incremental packing.
上级 c3330383
......@@ -176,6 +176,7 @@ extern int read_tree(void *buffer, unsigned long size, int stage);
extern int write_sha1_from_fd(const unsigned char *sha1, int fd);
extern int has_sha1_pack(const unsigned char *sha1);
extern int has_sha1_file(const unsigned char *sha1);
/* Convert to/from hex/sha1 representation */
......
......@@ -1267,6 +1267,12 @@ int write_sha1_from_fd(const unsigned char *sha1, int fd)
return 0;
}
int has_sha1_pack(const unsigned char *sha1)
{
struct pack_entry e;
return find_pack_entry(sha1, &e);
}
int has_sha1_file(const unsigned char *sha1)
{
struct stat st;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册