summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrandon Williams <bmwill@google.com>2018-05-17 22:51:47 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-05-17 23:13:10 (GMT)
commite808656c46e9d0e2e446b304a6f4d1f7dd0b25b5 (patch)
treee95bafa8c8f243feb48a3ab0de6fb2cc295aa8c6
parentc88134870e8b2da084e37fb86ff88fb7d7617d61 (diff)
downloadgit-e808656c46e9d0e2e446b304a6f4d1f7dd0b25b5.zip
git-e808656c46e9d0e2e446b304a6f4d1f7dd0b25b5.tar.gz
git-e808656c46e9d0e2e446b304a6f4d1f7dd0b25b5.tar.bz2
commit: convert commit_graft_pos() to handle arbitrary repositories
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>
-rw-r--r--commit.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/commit.c b/commit.c
index 684eeaa..0ec3d22 100644
--- 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);
}