Commit d3ef11e00f053995c712909df879ccbdc48144b3

Etienne Samson 2017-03-19T03:31:41

clar: exit immediately on initialization failure

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff --git a/tests/main.c b/tests/main.c
index f67c8ff..b4fccec 100644
--- a/tests/main.c
+++ b/tests/main.c
@@ -11,7 +11,12 @@ int main(int argc, char *argv[])
 
 	clar_test_init(argc, argv);
 
-	git_libgit2_init();
+	res = git_libgit2_init();
+	if (res < 0) {
+		fprintf(stderr, "failed to init libgit2");
+		return res;
+	}
+
 	cl_global_trace_register();
 	cl_sandbox_set_search_path_defaults();