summaryrefslogtreecommitdiff
path: root/commit.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-02-05 14:03:01 -0800
committerJunio C Hamano <gitster@pobox.com>2014-02-05 14:03:01 -0800
commit3c864743a68a81b5a15bbd92afcea74470c1bc2f (patch)
treec36b51250e9ca8a6d55a77a10d297a8090477a91 /commit.c
parentee5788e306a69933eeb5472e68fd6c4c7105d9ef (diff)
parente228c1736f25c59cd6da51ed97e03ecd80a935e6 (diff)
downloadgit-3c864743a68a81b5a15bbd92afcea74470c1bc2f.tar.gz
Merge branch 'js/lift-parent-count-limit' into maint
There is no reason to have a hardcoded upper limit of the number of parents for an octopus merge, created via the graft mechanism, but there was. * js/lift-parent-count-limit: Remove the line length limit for graft files
Diffstat (limited to 'commit.c')
-rw-r--r--commit.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/commit.c b/commit.c
index de16a3c0a2..57ebea2aee 100644
--- a/commit.c
+++ b/commit.c
@@ -196,19 +196,19 @@ bad_graft_data:
static int read_graft_file(const char *graft_file)
{
FILE *fp = fopen(graft_file, "r");
- char buf[1024];
+ struct strbuf buf = STRBUF_INIT;
if (!fp)
return -1;
- while (fgets(buf, sizeof(buf), fp)) {
+ while (!strbuf_getwholeline(&buf, fp, '\n')) {
/* The format is just "Commit Parent1 Parent2 ...\n" */
- int len = strlen(buf);
- struct commit_graft *graft = read_graft_line(buf, len);
+ struct commit_graft *graft = read_graft_line(buf.buf, buf.len);
if (!graft)
continue;
if (register_commit_graft(graft, 1))
- error("duplicate graft data: %s", buf);
+ error("duplicate graft data: %s", buf.buf);
}
fclose(fp);
+ strbuf_release(&buf);
return 0;
}