Skip to content

Commit

Permalink
git-annotate: fix -S on graft file with comments.
Browse files Browse the repository at this point in the history
The graft file can contain comment lines and read_graft_line can
return NULL for such an input, which should be skipped by the
reader.

Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed Nov 10, 2006
1 parent a19f901 commit 8eaf798
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion builtin-blame.c
Original file line number Diff line number Diff line change
@@ -1407,7 +1407,8 @@ static int read_ancestry(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);
register_commit_graft(graft, 0);
if (graft)
register_commit_graft(graft, 0);
}
fclose(fp);
return 0;

0 comments on commit 8eaf798

Please sign in to comment.