Merge branch 'js/lift-parent-count-limit'

There is no reason to have a hardcoded upper limit of the number of
parents for an octopus merge, created via the graft mechanism.

* js/lift-parent-count-limit:
  Remove the line length limit for graft files
This commit is contained in:
Junio C Hamano
2014-01-10 10:33:36 -08:00
4 changed files with 45 additions and 10 deletions

View File

@ -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;
}