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

commit.c: allow lookup_commit_reference_gently to handle arbitrary repositories

Signed-off-by: NStefan Beller <sbeller@google.com>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 286d258d
......@@ -24,16 +24,16 @@ int save_commit_buffer = 1;
const char *commit_type = "commit";
struct commit *lookup_commit_reference_gently_the_repository(
struct commit *lookup_commit_reference_gently(struct repository *r,
const struct object_id *oid, int quiet)
{
struct object *obj = deref_tag(the_repository,
parse_object(the_repository, oid),
struct object *obj = deref_tag(r,
parse_object(r, oid),
NULL, 0);
if (!obj)
return NULL;
return object_as_type(the_repository, obj, OBJ_COMMIT, quiet);
return object_as_type(r, obj, OBJ_COMMIT, quiet);
}
struct commit *lookup_commit_reference_the_repository(const struct object_id *oid)
......
......@@ -67,9 +67,7 @@ struct commit *lookup_commit(struct repository *r, const struct object_id *oid);
#define lookup_commit_reference(r, o) \
lookup_commit_reference_##r(o)
struct commit *lookup_commit_reference_the_repository(const struct object_id *oid);
#define lookup_commit_reference_gently(r, o, q) \
lookup_commit_reference_gently_##r(o, q)
struct commit *lookup_commit_reference_gently_the_repository(
struct commit *lookup_commit_reference_gently(struct repository *r,
const struct object_id *oid,
int quiet);
struct commit *lookup_commit_reference_by_name(const char *name);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册