Skip to content

Commit fd4e3b2

Browse files
authored
Merge pull request libgit2#4885 from pks-t/pks/apply-test-fixups
apply: small fixups in the test suite
2 parents cf83809 + afc64bc commit fd4e3b2

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

tests/apply/both.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ void test_apply_both__application_failure_leaves_workdir_unmodified(void)
244244
"This is a modification.\n");
245245

246246
cl_git_pass(git_repository_index(&index, repo));
247-
git_index_add_bypath(index, "veal.txt");
247+
cl_git_pass(git_index_add_bypath(index, "veal.txt"));
248248
cl_git_pass(git_index_write(index));
249249
git_index_free(index);
250250

@@ -291,7 +291,7 @@ void test_apply_both__keeps_nonconflicting_changes(void)
291291
idx_entry.mode = 0100644;
292292
idx_entry.path = "beef.txt";
293293
cl_git_pass(git_oid_fromstr(&idx_entry.id, "898d12687fb35be271c27c795a6b32c8b51da79e"));
294-
git_index_add(index, &idx_entry);
294+
cl_git_pass(git_index_add(index, &idx_entry));
295295

296296
cl_git_pass(git_index_remove(index, "bouilli.txt", 0));
297297
cl_git_pass(git_index_write(index));
@@ -337,7 +337,7 @@ void test_apply_both__can_apply_nonconflicting_file_changes(void)
337337
"This line is added in the index and the workdir.\n");
338338

339339
cl_git_pass(git_repository_index(&index, repo));
340-
git_index_add_bypath(index, "asparagus.txt");
340+
cl_git_pass(git_index_add_bypath(index, "asparagus.txt"));
341341
cl_git_pass(git_index_write(index));
342342
git_index_free(index);
343343

tests/apply/partial.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ static int apply_buf(
104104
}
105105

106106
git__free(filename);
107-
git_buf_free(&result);
108-
git_buf_free(&patchbuf);
107+
git_buf_dispose(&result);
108+
git_buf_dispose(&patchbuf);
109109
git_patch_free(patch);
110110

111111
return error;

tests/apply/workdir.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ void test_apply_workdir__modified_index_with_unmodified_workdir_is_ok(void)
167167
sizeof(struct merge_index_entry);
168168

169169
/* mutate the index and leave the workdir matching HEAD */
170-
git_repository_index(&index, repo);
170+
cl_git_pass(git_repository_index(&index, repo));
171171

172172
idx_entry.mode = 0100644;
173173
idx_entry.path = "veal.txt";

0 commit comments

Comments
 (0)