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 <junkio@cox.net>
Junio C Hamano committed
Nov 10, 2006 at 13:39 UTC
8eaf79869f9eddf50ddffffb8d73a054e0514fcd
1 file changed
+2
-1
builtin-blame.c
+2
-1
@@ -1407,7 +1407,8 @@ static int read_ancestry(const char *graft_file)
1407
/* The format is just "Commit Parent1 Parent2 ...\n" */
1408
int len = strlen(buf);
1409
struct commit_graft *graft = read_graft_line(buf, len);
1410
- register_commit_graft(graft, 0);
1410
+ if (graft)
1411
+ register_commit_graft(graft, 0);
1412
}
1413
fclose(fp);
1414
return 0;