commit.c: allow lookup_commit_reference to handle arbitrary repositories

Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Stefan Beller committed Jun 28, 2018 at 18:22 UTC 1f6c72fe55fded90cadcefffe5bd980a6f896579
2 files changed +4 -5
commit.c
+2 -2
@@ -36,9 +36,9 @@ struct commit *lookup_commit_reference_gently(struct repository *r,
36 return object_as_type(r, obj, OBJ_COMMIT, quiet);
37 }
38
39 -struct commit *lookup_commit_reference_the_repository(const struct object_id *oid)
39 +struct commit *lookup_commit_reference(struct repository *r, const struct object_id *oid)
40 {
41 - return lookup_commit_reference_gently(the_repository, oid, 0);
41 + return lookup_commit_reference_gently(r, oid, 0);
42 }
43
44 struct commit *lookup_commit_or_die(const struct object_id *oid, const char *ref_name)
commit.h
+2 -3
@@ -64,9 +64,8 @@ void add_name_decoration(enum decoration_type type, const char *name, struct obj
64 const struct name_decoration *get_name_decoration(const struct object *obj);
65
66 struct commit *lookup_commit(struct repository *r, const struct object_id *oid);
67 -#define lookup_commit_reference(r, o) \
68 - lookup_commit_reference_##r(o)
69 -struct commit *lookup_commit_reference_the_repository(const struct object_id *oid);
67 +struct commit *lookup_commit_reference(struct repository *r,
68 + const struct object_id *oid);
69 struct commit *lookup_commit_reference_gently(struct repository *r,
70 const struct object_id *oid,
71 int quiet);