[PATCH 13/14] test-tool repository: check return value of `lookup_commit()`

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Johannes Schindelin <johannes.schindelin@xxxxxx>

On the off-chance that it's NULL...

Signed-off-by: Johannes Schindelin <johannes.schindelin@xxxxxx>
---
 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





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux