]> git.proxmox.com Git - libgit2.git/blob - tests/diff/diff_helpers.h
New upstream version 1.1.0+dfsg.1
[libgit2.git] / tests / diff / diff_helpers.h
1 #include "futils.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[11]; /* 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_binary_cb(
46 const git_diff_delta *delta,
47 const git_diff_binary *binary,
48 void *cb_data);
49
50 extern int diff_hunk_cb(
51 const git_diff_delta *delta,
52 const git_diff_hunk *hunk,
53 void *cb_data);
54
55 extern int diff_line_cb(
56 const git_diff_delta *delta,
57 const git_diff_hunk *hunk,
58 const git_diff_line *line,
59 void *cb_data);
60
61 extern int diff_foreach_via_iterator(
62 git_diff *diff,
63 git_diff_file_cb file_cb,
64 git_diff_binary_cb binary_cb,
65 git_diff_hunk_cb hunk_cb,
66 git_diff_line_cb line_cb,
67 void *data);
68
69 extern void diff_print(FILE *fp, git_diff *diff);
70 extern void diff_print_raw(FILE *fp, git_diff *diff);
71
72 extern void diff_assert_equal(git_diff *a, git_diff *b);
73