]> git.ipfire.org Git - thirdparty/git.git/commitdiff
commit: convert commit_graft_pos() to handle arbitrary repositories
authorBrandon Williams <bmwill@google.com>
Thu, 17 May 2018 22:51:47 +0000 (15:51 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 17 May 2018 23:13:10 +0000 (08:13 +0900)
Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit.c

index 684eeaa2ccd65407a5371a63aef4de842919059c..0ec3d22813a835190668acac788e2af5a8638df8 100644 (file)
--- a/commit.c
+++ b/commit.c
@@ -104,11 +104,10 @@ static const unsigned char *commit_graft_sha1_access(size_t index, void *table)
        return commit_graft_table[index]->oid.hash;
 }
 
-#define commit_graft_pos(r, s) commit_graft_pos_##r(s)
-static int commit_graft_pos_the_repository(const unsigned char *sha1)
+static int commit_graft_pos(struct repository *r, const unsigned char *sha1)
 {
-       return sha1_pos(sha1, the_repository->parsed_objects->grafts,
-                       the_repository->parsed_objects->grafts_nr,
+       return sha1_pos(sha1, r->parsed_objects->grafts,
+                       r->parsed_objects->grafts_nr,
                        commit_graft_sha1_access);
 }