From f335ecd6e126aa9dea28786522c0e6ce71596e91 Mon Sep 17 00:00:00 2001 From: Russell Belfer Date: Thu, 30 Aug 2012 14:24:16 -0700 Subject: Diff iterators This refactors the diff output code so that an iterator object can be used to traverse and generate the diffs, instead of just the `foreach()` style with callbacks. The code has been rearranged so that the two styles can still share most functions. This also replaces `GIT_REVWALKOVER` with `GIT_ITEROVER` and uses that as a common error code for marking the end of iteration when using a iterator style of object. --- tests-clar/diff/diff_helpers.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests-clar/diff/diff_helpers.h') diff --git a/tests-clar/diff/diff_helpers.h b/tests-clar/diff/diff_helpers.h index 0aaa6c111..79e140921 100644 --- a/tests-clar/diff/diff_helpers.h +++ b/tests-clar/diff/diff_helpers.h @@ -45,3 +45,9 @@ extern int diff_line_fn( const char *content, size_t content_len); +extern int diff_foreach_via_iterator( + git_diff_list *diff, + void *data, + git_diff_file_fn file_cb, + git_diff_hunk_fn hunk_cb, + git_diff_data_fn line_cb); -- cgit v1.2.1