X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=commit.c;h=2717dd81c346d89bf5d6727e3aa1f5b65ff39aca;hb=c82a22c39cbc32576f64f5c6b3f24b99ea8149c7;hp=ca25574500fe3c88d2cc2953b7dd019b3acab9e7;hpb=170abc81a0f7bc02702189bacf7eeab74223d922;p=git.git diff --git a/commit.c b/commit.c index ca255745..2717dd81 100644 --- a/commit.c +++ b/commit.c @@ -160,8 +160,8 @@ struct commit_graft *read_graft_line(char *buf, int len) if (buf[len-1] == '\n') buf[--len] = 0; - if (buf[0] == '#') - return 0; + if (buf[0] == '#' || buf[0] == '\0') + return NULL; if ((len + 1) % 41) { bad_graft_data: error("bad graft data: %s", buf); @@ -192,6 +192,8 @@ int read_graft_file(const char *graft_file) /* The format is just "Commit Parent1 Parent2 ...\n" */ int len = strlen(buf); struct commit_graft *graft = read_graft_line(buf, len); + if (!graft) + continue; if (register_commit_graft(graft, 1)) error("duplicate graft data: %s", buf); }