commit.c: allow lookup_commit_reference_gently to handle arbitrary repositories
authorStefan Beller <sbeller@google.com>
Fri, 29 Jun 2018 01:22:21 +0000 (18:22 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 29 Jun 2018 17:43:40 +0000 (10:43 -0700)
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit.c
commit.h
index 15b044331a16d6f20abe23b14a2499a090fb9140..08b4602f43fefb63983a28b7b797ca75b2b1921a 100644 (file)
--- a/commit.c
+++ b/commit.c
@@ -24,16 +24,16 @@ int save_commit_buffer = 1;
 
 const char *commit_type = "commit";
 
 
 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)
 {
                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;
                                       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)
 }
 
 struct commit *lookup_commit_reference_the_repository(const struct object_id *oid)
index d61585df5bc6ef18e3e323e38675dc2ad059f236..f1f25957de4740753f869bc92c9b93ca59495c80 100644 (file)
--- 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(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);
                                              const struct object_id *oid,
                                              int quiet);
 struct commit *lookup_commit_reference_by_name(const char *name);