Skip to content

Commit 1f6c72f

Browse files
stefanbellergitster
authored andcommitted
commit.c: allow lookup_commit_reference to handle arbitrary repositories
Signed-off-by: Stefan Beller <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d9a05e7 commit 1f6c72f

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

commit.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ struct commit *lookup_commit_reference_gently(struct repository *r,
3636
return object_as_type(r, obj, OBJ_COMMIT, quiet);
3737
}
3838

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)
4040
{
41-
return lookup_commit_reference_gently(the_repository, oid, 0);
41+
return lookup_commit_reference_gently(r, oid, 0);
4242
}
4343

4444
struct commit *lookup_commit_or_die(const struct object_id *oid, const char *ref_name)

commit.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,8 @@ void add_name_decoration(enum decoration_type type, const char *name, struct obj
6464
const struct name_decoration *get_name_decoration(const struct object *obj);
6565

6666
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);
7069
struct commit *lookup_commit_reference_gently(struct repository *r,
7170
const struct object_id *oid,
7271
int quiet);

0 commit comments

Comments
 (0)