summaryrefslogtreecommitdiff
path: root/tests-clar/diff/diff_helpers.c
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-10-15 15:10:07 -0700
committerRussell Belfer <rb@github.com>2013-10-15 15:10:07 -0700
commit10672e3e455eba2d4ca983070ed427caeeb24a6f (patch)
treee812af06091362849e9ecd279c5547e401cb0862 /tests-clar/diff/diff_helpers.c
parent3ff1d123736e5686fb9ec16e65828d5b8ffa2b30 (diff)
downloadlibgit2-10672e3e455eba2d4ca983070ed427caeeb24a6f.tar.gz
Diff API cleanup
This lays groundwork for separating formatting options from diff creation options. This groups the formatting flags separately from the diff list creation flags and reorders the options. This also tweaks some APIs to further separate code that uses patches from code that just looks at git_diffs.
Diffstat (limited to 'tests-clar/diff/diff_helpers.c')
-rw-r--r--tests-clar/diff/diff_helpers.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests-clar/diff/diff_helpers.c b/tests-clar/diff/diff_helpers.c
index 34ef1df5a..cf768865e 100644
--- a/tests-clar/diff/diff_helpers.c
+++ b/tests-clar/diff/diff_helpers.c
@@ -162,8 +162,8 @@ int diff_foreach_via_iterator(
const git_diff_delta *delta;
size_t h, num_h;
- cl_git_pass(git_patch_from_diff(&patch, &delta, diff, d));
- cl_assert(delta);
+ cl_git_pass(git_patch_from_diff(&patch, diff, d));
+ cl_assert((delta = git_patch_get_delta(patch)) != NULL);
/* call file_cb for this file */
if (file_cb != NULL && file_cb(delta, (float)d / num_d, data) != 0) {
@@ -245,10 +245,12 @@ static int diff_print_cb(
void diff_print(FILE *fp, git_diff *diff)
{
- cl_git_pass(git_diff_print_patch(diff, diff_print_cb, fp ? fp : stderr));
+ cl_git_pass(git_diff_print(
+ diff, GIT_DIFF_FORMAT_PATCH, diff_print_cb, fp ? fp : stderr));
}
void diff_print_raw(FILE *fp, git_diff *diff)
{
- cl_git_pass(git_diff_print_raw(diff, diff_print_cb, fp ? fp : stderr));
+ cl_git_pass(git_diff_print(
+ diff, GIT_DIFF_FORMAT_RAW, diff_print_cb, fp ? fp : stderr));
}