[PATCH 13/14] test-tool repository: check return value of `lookup_commit()`
From: Johannes Schindelin <johannes.schindelin@gmx.de>
On the off-chance that it's NULL...
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
t/helper/test-repository.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/t/helper/test-repository.c b/t/helper/test-repository.c
index 63c37de33d22..05417d8f43dc 100644
--- a/t/helper/test-repository.c
+++ b/t/helper/test-repository.c
@@ -27,6 +27,8 @@ static void test_parse_commit_in_graph(const char *gitdir, const char *worktree,
repo_set_hash_algo(the_repository, hash_algo_by_ptr(r.hash_algo));
c = lookup_commit(&r, commit_oid);
+ if (!c)
+ die("Could not look up %s", oid_to_hex(commit_oid));
if (!parse_commit_in_graph(&r, c))
die("Couldn't parse commit");
--
gitgitgadget