Skip to content

Commit d9a05e7

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

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

commit.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@ int save_commit_buffer = 1;
2424

2525
const char *commit_type = "commit";
2626

27-
struct commit *lookup_commit_reference_gently_the_repository(
27+
struct commit *lookup_commit_reference_gently(struct repository *r,
2828
const struct object_id *oid, int quiet)
2929
{
30-
struct object *obj = deref_tag(the_repository,
31-
parse_object(the_repository, oid),
30+
struct object *obj = deref_tag(r,
31+
parse_object(r, oid),
3232
NULL, 0);
3333

3434
if (!obj)
3535
return NULL;
36-
return object_as_type(the_repository, obj, OBJ_COMMIT, quiet);
36+
return object_as_type(r, obj, OBJ_COMMIT, quiet);
3737
}
3838

3939
struct commit *lookup_commit_reference_the_repository(const struct object_id *oid)

commit.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,7 @@ struct commit *lookup_commit(struct repository *r, const struct object_id *oid);
6767
#define lookup_commit_reference(r, o) \
6868
lookup_commit_reference_##r(o)
6969
struct commit *lookup_commit_reference_the_repository(const struct object_id *oid);
70-
#define lookup_commit_reference_gently(r, o, q) \
71-
lookup_commit_reference_gently_##r(o, q)
72-
struct commit *lookup_commit_reference_gently_the_repository(
70+
struct commit *lookup_commit_reference_gently(struct repository *r,
7371
const struct object_id *oid,
7472
int quiet);
7573
struct commit *lookup_commit_reference_by_name(const char *name);

0 commit comments

Comments
 (0)