From 8eaf79869f9eddf50ddffffb8d73a054e0514fcd Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 10 Nov 2006 13:39:01 -0800 Subject: git-annotate: fix -S on graft file with comments. 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 diff --git a/builtin-blame.c b/builtin-blame.c index 1666022..066dee7 100644 --- a/builtin-blame.c +++ b/builtin-blame.c @@ -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; -- cgit v0.10.2-6-g49f6