Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'tests/diff/diff_helpers.c')
-rw-r--r--tests/diff/diff_helpers.c29
1 files changed, 7 insertions, 22 deletions
diff --git a/tests/diff/diff_helpers.c b/tests/diff/diff_helpers.c
index 33bb561f6..279cb20c5 100644
--- a/tests/diff/diff_helpers.c
+++ b/tests/diff/diff_helpers.c
@@ -1,5 +1,6 @@
#include "clar_libgit2.h"
#include "diff_helpers.h"
+#include "git2/sys/diff.h"
git_tree *resolve_commit_oid_to_tree(
git_repository *repo,
@@ -215,32 +216,16 @@ abort:
return GIT_EUSER;
}
-static int diff_print_cb(
- const git_diff_delta *delta,
- const git_diff_hunk *hunk,
- const git_diff_line *line,
- void *payload)
-{
- FILE *fp = payload;
-
- GIT_UNUSED(delta); GIT_UNUSED(hunk);
-
- if (line->origin == GIT_DIFF_LINE_CONTEXT ||
- line->origin == GIT_DIFF_LINE_ADDITION ||
- line->origin == GIT_DIFF_LINE_DELETION)
- fputc(line->origin, fp);
- fwrite(line->content, 1, line->content_len, fp);
- return 0;
-}
-
void diff_print(FILE *fp, git_diff *diff)
{
- cl_git_pass(git_diff_print(
- diff, GIT_DIFF_FORMAT_PATCH, diff_print_cb, fp ? fp : stderr));
+ cl_git_pass(
+ git_diff_print(diff, GIT_DIFF_FORMAT_PATCH,
+ git_diff_print_callback__to_file_handle, fp ? fp : stderr));
}
void diff_print_raw(FILE *fp, git_diff *diff)
{
- cl_git_pass(git_diff_print(
- diff, GIT_DIFF_FORMAT_RAW, diff_print_cb, fp ? fp : stderr));
+ cl_git_pass(
+ git_diff_print(diff, GIT_DIFF_FORMAT_RAW,
+ git_diff_print_callback__to_file_handle, fp ? fp : stderr));
}