diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2015-05-25 20:03:59 -0400 |
---|---|---|
committer | Edward Thomson <ethomson@microsoft.com> | 2015-06-12 09:39:20 -0400 |
commit | 8147b1aff56c0f36f6afee9b8810fc74776e1f58 (patch) | |
tree | 298396fb80a973b990e21084e29b0466ceafe5ed /tests/diff/index.c | |
parent | ac7012a81f0bdc472a3d22393291eb7d130705d1 (diff) | |
download | libgit2-8147b1aff56c0f36f6afee9b8810fc74776e1f58.tar.gz |
diff: introduce binary diff callbacks
Introduce a new binary diff callback to provide the actual binary
delta contents to callers. Create this data from the diff contents
(instead of directly from the ODB) to support binary diffs including
the workdir, not just things coming out of the ODB.
Diffstat (limited to 'tests/diff/index.c')
-rw-r--r-- | tests/diff/index.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/diff/index.c b/tests/diff/index.c index cf883f12a..242fb0046 100644 --- a/tests/diff/index.c +++ b/tests/diff/index.c @@ -35,7 +35,7 @@ void test_diff_index__0(void) cl_git_pass(git_diff_tree_to_index(&diff, g_repo, a, NULL, &opts)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); /* to generate these values: * - cd to tests/resources/status, @@ -63,7 +63,7 @@ void test_diff_index__0(void) cl_git_pass(git_diff_tree_to_index(&diff, g_repo, b, NULL, &opts)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); /* to generate these values: * - cd to tests/resources/status, @@ -127,8 +127,8 @@ void test_diff_index__1(void) cl_git_pass(git_diff_tree_to_index(&diff, g_repo, a, NULL, &opts)); - cl_assert_equal_i( - 1, git_diff_foreach(diff, diff_stop_after_2_files, NULL, NULL, &exp) ); + cl_assert_equal_i(1, git_diff_foreach( + diff, diff_stop_after_2_files, NULL, NULL, NULL, &exp) ); cl_assert_equal_i(2, exp.files); @@ -193,7 +193,7 @@ static void do_conflicted_diff(diff_expects *exp, unsigned long flags) cl_git_pass(git_diff_tree_to_index(&diff, g_repo, a, index, &opts)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, exp)); git_diff_free(diff); git_tree_free(a); |