Commit fe215153083401608b643213474b5979018abfa0

Patrick Steinhardt 2018-11-13T14:08:49

tests: apply: fix missing `cl_git_pass` wrappers Some function calls in the new "apply" test suite were missing the checks whether they succeeded as expected. Fix this by adding the missing `cl_git_pass` wrappers.

diff --git a/tests/apply/both.c b/tests/apply/both.c
index 5091b8c..400df5e 100644
--- a/tests/apply/both.c
+++ b/tests/apply/both.c
@@ -244,7 +244,7 @@ void test_apply_both__application_failure_leaves_workdir_unmodified(void)
 	    "This is a modification.\n");
 
 	cl_git_pass(git_repository_index(&index, repo));
-	git_index_add_bypath(index, "veal.txt");
+	cl_git_pass(git_index_add_bypath(index, "veal.txt"));
 	cl_git_pass(git_index_write(index));
 	git_index_free(index);
 
@@ -291,7 +291,7 @@ void test_apply_both__keeps_nonconflicting_changes(void)
 	idx_entry.mode = 0100644;
 	idx_entry.path = "beef.txt";
 	cl_git_pass(git_oid_fromstr(&idx_entry.id, "898d12687fb35be271c27c795a6b32c8b51da79e"));
-	git_index_add(index, &idx_entry);
+	cl_git_pass(git_index_add(index, &idx_entry));
 
 	cl_git_pass(git_index_remove(index, "bouilli.txt", 0));
 	cl_git_pass(git_index_write(index));
@@ -337,7 +337,7 @@ void test_apply_both__can_apply_nonconflicting_file_changes(void)
 	    "This line is added in the index and the workdir.\n");
 
 	cl_git_pass(git_repository_index(&index, repo));
-	git_index_add_bypath(index, "asparagus.txt");
+	cl_git_pass(git_index_add_bypath(index, "asparagus.txt"));
 	cl_git_pass(git_index_write(index));
 	git_index_free(index);
 
diff --git a/tests/apply/workdir.c b/tests/apply/workdir.c
index 1a82925..d0d9c1a 100644
--- a/tests/apply/workdir.c
+++ b/tests/apply/workdir.c
@@ -167,7 +167,7 @@ void test_apply_workdir__modified_index_with_unmodified_workdir_is_ok(void)
 		sizeof(struct merge_index_entry);
 
 	/* mutate the index and leave the workdir matching HEAD */
-	git_repository_index(&index, repo);
+	cl_git_pass(git_repository_index(&index, repo));
 
 	idx_entry.mode = 0100644;
 	idx_entry.path = "veal.txt";