diff options
| author | Vicent Martà <vicent@github.com> | 2013-11-14 14:26:15 -0800 |
|---|---|---|
| committer | Vicent Martà <vicent@github.com> | 2013-11-14 14:26:15 -0800 |
| commit | 845eed800a85b0c51cead6c17e3cb4013564fb37 (patch) | |
| tree | a0ba0fa54e31874ea6353e01a658f67e64c66df8 /tests/diff/diff_helpers.h | |
| parent | 7b947bf5cc59eefa83c28eb5f5fd8434207ebb8b (diff) | |
| parent | 83e1efbf462347dac3e1c884bb0b017d495b6f38 (diff) | |
| download | libgit2-845eed800a85b0c51cead6c17e3cb4013564fb37.tar.gz | |
Merge pull request #1962 from libgit2/rename-tests
Rename tests directory
Diffstat (limited to 'tests/diff/diff_helpers.h')
| -rw-r--r-- | tests/diff/diff_helpers.h | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/tests/diff/diff_helpers.h b/tests/diff/diff_helpers.h new file mode 100644 index 000000000..bf21f4b1f --- /dev/null +++ b/tests/diff/diff_helpers.h @@ -0,0 +1,64 @@ +#include "fileops.h" +#include "git2/diff.h" + +extern git_tree *resolve_commit_oid_to_tree( + git_repository *repo, const char *partial_oid); + +typedef struct { + int files; + int files_binary; + + int file_status[10]; /* indexed by git_delta_t value */ + + int hunks; + int hunk_new_lines; + int hunk_old_lines; + + int lines; + int line_ctxt; + int line_adds; + int line_dels; + + /* optional arrays of expected specific values */ + const char **names; + int *statuses; + + int debug; + +} diff_expects; + +typedef struct { + const char *path; + const char *matched_pathspec; +} notify_expected; + +extern int diff_file_cb( + const git_diff_delta *delta, + float progress, + void *cb_data); + +extern int diff_print_file_cb( + const git_diff_delta *delta, + float progress, + void *cb_data); + +extern int diff_hunk_cb( + const git_diff_delta *delta, + const git_diff_hunk *hunk, + void *cb_data); + +extern int diff_line_cb( + const git_diff_delta *delta, + const git_diff_hunk *hunk, + const git_diff_line *line, + void *cb_data); + +extern int diff_foreach_via_iterator( + git_diff *diff, + git_diff_file_cb file_cb, + git_diff_hunk_cb hunk_cb, + git_diff_line_cb line_cb, + void *data); + +extern void diff_print(FILE *fp, git_diff *diff); +extern void diff_print_raw(FILE *fp, git_diff *diff); |
