reading $GIT_DIR/info/graft - skip comments correctly.

Noticed by Yann Dirson.

Signed-off-by: Junio C Hamano <junkio@cox.net>
diff --git a/commit.c b/commit.c
index ca25574..05c4c92 100644
--- a/commit.c
+++ b/commit.c
@@ -161,7 +161,7 @@
 	if (buf[len-1] == '\n')
 		buf[--len] = 0;
 	if (buf[0] == '#')
-		return 0;
+		return NULL;
 	if ((len + 1) % 41) {
 	bad_graft_data:
 		error("bad graft data: %s", buf);
@@ -192,6 +192,8 @@
 		/* 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);
 	}