Merge pull request #4885 from pks-t/pks/apply-test-fixups apply: small fixups in the test suite
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
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/partial.c b/tests/apply/partial.c
index 243dccf..466a927 100644
--- a/tests/apply/partial.c
+++ b/tests/apply/partial.c
@@ -104,8 +104,8 @@ static int apply_buf(
}
git__free(filename);
- git_buf_free(&result);
- git_buf_free(&patchbuf);
+ git_buf_dispose(&result);
+ git_buf_dispose(&patchbuf);
git_patch_free(patch);
return error;
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";