Skip to content

Commit d0e5dd0

Browse files
bmwillgitster
authored andcommitted
commit: convert read_graft_file 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>
1 parent a3b78e8 commit d0e5dd0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

commit.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,7 @@ struct commit_graft *read_graft_line(struct strbuf *line)
177177
return NULL;
178178
}
179179

180-
#define read_graft_file(r, f) read_graft_file_##r(f)
181-
static int read_graft_file_the_repository(const char *graft_file)
180+
static int read_graft_file(struct repository *r, const char *graft_file)
182181
{
183182
FILE *fp = fopen_or_warn(graft_file, "r");
184183
struct strbuf buf = STRBUF_INIT;
@@ -189,7 +188,7 @@ static int read_graft_file_the_repository(const char *graft_file)
189188
struct commit_graft *graft = read_graft_line(&buf);
190189
if (!graft)
191190
continue;
192-
if (register_commit_graft(the_repository, graft, 1))
191+
if (register_commit_graft(r, graft, 1))
193192
error("duplicate graft data: %s", buf.buf);
194193
}
195194
fclose(fp);

0 commit comments

Comments
 (0)