提交 bd27f50c 编写于 作者: S Stefan Beller 提交者: Junio C Hamano

sha1_file: allow map_sha1_file to handle arbitrary repositories

Signed-off-by: NStefan Beller <sbeller@google.com>
Signed-off-by: NJonathan Nieder <jrnieder@gmail.com>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
Signed-off-by: NNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 1fea63e1
......@@ -127,7 +127,6 @@ void raw_object_store_clear(struct raw_object_store *o);
*/
void sha1_file_name(struct repository *r, struct strbuf *buf, const unsigned char *sha1);
#define map_sha1_file(r, s, sz) map_sha1_file_##r(s, sz)
void *map_sha1_file_the_repository(const unsigned char *sha1, unsigned long *size);
void *map_sha1_file(struct repository *r, const unsigned char *sha1, unsigned long *size);
#endif /* OBJECT_STORE_H */
......@@ -957,9 +957,10 @@ static void *map_sha1_file_1(struct repository *r, const char *path,
return map;
}
void *map_sha1_file_the_repository(const unsigned char *sha1, unsigned long *size)
void *map_sha1_file(struct repository *r,
const unsigned char *sha1, unsigned long *size)
{
return map_sha1_file_1(the_repository, NULL, sha1, size);
return map_sha1_file_1(r, NULL, sha1, size);
}
static int unpack_sha1_short_header(git_zstream *stream,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册