Skip to content

Commit 8e32166

Browse files
committed
test-tool repository: check return value of lookup_commit()
On the off-chance that it's NULL... Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent cb4acd4 commit 8e32166

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎t/helper/test-repository.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ static void test_parse_commit_in_graph(const char *gitdir, const char *worktree,
2323
repo_set_hash_algo(the_repository, hash_algo_by_ptr(r.hash_algo));
2424

2525
c = lookup_commit(&r, commit_oid);
26+
if (!c)
27+
die("Could not look up %s", oid_to_hex(commit_oid));
2628

2729
if (!parse_commit_in_graph(&r, c))
2830
die("Couldn't parse commit");

0 commit comments

Comments
 (0)