summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrandon Williams <bmwill@google.com>2018-05-17 22:51:49 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-05-17 23:13:10 (GMT)
commitd0e5dd0ed49a8e79dab8a027ab14ee29709b47c6 (patch)
tree311fc72ae5ed1a998e6ebeadefc355b959fc3a86
parenta3b78e833b06f4bfdef8c4d70d4d269226bebd09 (diff)
downloadgit-d0e5dd0ed49a8e79dab8a027ab14ee29709b47c6.zip
git-d0e5dd0ed49a8e79dab8a027ab14ee29709b47c6.tar.gz
git-d0e5dd0ed49a8e79dab8a027ab14ee29709b47c6.tar.bz2
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>
-rw-r--r--commit.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/commit.c b/commit.c
index 8a2ab53..3fcb2fd 100644
--- a/commit.c
+++ b/commit.c
@@ -177,8 +177,7 @@ bad_graft_data:
return NULL;
}
-#define read_graft_file(r, f) read_graft_file_##r(f)
-static int read_graft_file_the_repository(const char *graft_file)
+static int read_graft_file(struct repository *r, const char *graft_file)
{
FILE *fp = fopen_or_warn(graft_file, "r");
struct strbuf buf = STRBUF_INIT;
@@ -189,7 +188,7 @@ static int read_graft_file_the_repository(const char *graft_file)
struct commit_graft *graft = read_graft_line(&buf);
if (!graft)
continue;
- if (register_commit_graft(the_repository, graft, 1))
+ if (register_commit_graft(r, graft, 1))
error("duplicate graft data: %s", buf.buf);
}
fclose(fp);