From 42281e007e15713713b2ff4324d60360332e194e Mon Sep 17 00:00:00 2001 From: Vicent Marti Date: Sun, 16 May 2010 01:52:31 +0200 Subject: Add unit tests for Commit parsing A few initial tests for commit parsing: "parse_buffer_test" tests git_commit__parse_buffer() with several malformed commit messages and a few corner cases which should pass. "parse_oid_test" tests git_commit__parse_oid() with several malformed commit lines containing broken SHA1 OIDs. Signed-off-by: Vicent Marti Signed-off-by: Andreas Ericsson --- src/commit.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/commit.c') diff --git a/src/commit.c b/src/commit.c index bbb0d9beb..1b30c5d6f 100644 --- a/src/commit.c +++ b/src/commit.c @@ -40,6 +40,9 @@ git_commit *git_commit_lookup(git_revpool *pool, const git_oid *id) git_obj commit_obj; git_commit *commit = NULL; + if (pool == NULL || pool->db == NULL) + return NULL; + /* * TODO: check if the commit is already cached in the * revpool instead of loading it from the odb -- cgit v1.2.1