summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Stefan Beller <sbeller@google.com>2018-06-28 18:22:21 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-06-29 10:43:40 -0700
commitd9a05e74ec01bb59fccb70c005269d930cd60d9a (patch)
tree6b099c73c66d684898d04b1a627d8bde60140b30
parenttag.c: allow deref_tag to handle arbitrary repositories (diff)
downloadtgif-d9a05e74ec01bb59fccb70c005269d930cd60d9a.tar.xz
commit.c: allow lookup_commit_reference_gently to handle arbitrary repositories
Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--commit.c8
-rw-r--r--commit.h4
2 files changed, 5 insertions, 7 deletions
diff --git a/commit.c b/commit.c
index 15b044331a..08b4602f43 100644
--- a/commit.c
+++ b/commit.c
@@ -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)
diff --git a/commit.h b/commit.h
index d61585df5b..f1f25957de 100644
--- a/commit.h
+++ b/commit.h
@@ -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);