Skip to content

Commit 3fef606

Browse files
dschogitster
authored andcommitted
test-tool repository: check return value of lookup_commit()
On the off-chance that it's NULL... Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e5449c5 commit 3fef606

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

t/helper/test-repository.c

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

2929
c = lookup_commit(&r, commit_oid);
30+
if (!c)
31+
die("Could not look up %s", oid_to_hex(commit_oid));
3032

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

0 commit comments

Comments
 (0)