From: Brandon Williams Date: Thu, 17 May 2018 22:51:47 +0000 (-0700) Subject: commit: convert commit_graft_pos() to handle arbitrary repositories X-Git-Tag: v2.19.0-rc0~166^2~7 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/e808656c46e9d0e2e446b304a6f4d1f7dd0b25b5 commit: convert commit_graft_pos() to handle arbitrary repositories Signed-off-by: Brandon Williams Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- diff --git a/commit.c b/commit.c index 684eeaa2cc..0ec3d22813 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); }