]> git.proxmox.com Git - libgit2.git/blob - tests/diff/diff_helpers.h
Rename tests-clar to tests
[libgit2.git] / tests / diff / diff_helpers.h
1 #include "fileops.h"
2 #include "git2/diff.h"
3
4 extern git_tree *resolve_commit_oid_to_tree(
5 git_repository *repo, const char *partial_oid);
6
7 typedef struct {
8 int files;
9 int files_binary;
10
11 int file_status[10]; /* indexed by git_delta_t value */
12
13 int hunks;
14 int hunk_new_lines;
15 int hunk_old_lines;
16
17 int lines;
18 int line_ctxt;
19 int line_adds;
20 int line_dels;
21
22 /* optional arrays of expected specific values */
23 const char **names;
24 int *statuses;
25
26 int debug;
27
28 } diff_expects;
29
30 typedef struct {
31 const char *path;
32 const char *matched_pathspec;
33 } notify_expected;
34
35 extern int diff_file_cb(
36 const git_diff_delta *delta,
37 float progress,
38 void *cb_data);
39
40 extern int diff_print_file_cb(
41 const git_diff_delta *delta,
42 float progress,
43 void *cb_data);
44
45 extern int diff_hunk_cb(
46 const git_diff_delta *delta,
47 const git_diff_hunk *hunk,
48 void *cb_data);
49
50 extern int diff_line_cb(
51 const git_diff_delta *delta,
52 const git_diff_hunk *hunk,
53 const git_diff_line *line,
54 void *cb_data);
55
56 extern int diff_foreach_via_iterator(
57 git_diff *diff,
58 git_diff_file_cb file_cb,
59 git_diff_hunk_cb hunk_cb,
60 git_diff_line_cb line_cb,
61 void *data);
62
63 extern void diff_print(FILE *fp, git_diff *diff);
64 extern void diff_print_raw(FILE *fp, git_diff *diff);