Commits

Junio C Hamano  committed 8eaf798

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>

  • Participants
  • Parent commits a19f901

Comments (0)

Files changed (1)

File builtin-blame.c

 		/* 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;