diff_helpers.h 990 Bytes
Newer Older
1
#include "fileops.h"
2
#include "git2/diff.h"
3 4 5

extern git_tree *resolve_commit_oid_to_tree(
	git_repository *repo, const char *partial_oid);
6 7 8

typedef struct {
	int files;
9 10
	int files_binary;

11
	int file_status[10]; /* indexed by git_delta_t value */
12 13 14 15 16 17 18 19 20 21 22

	int hunks;
	int hunk_new_lines;
	int hunk_old_lines;

	int lines;
	int line_ctxt;
	int line_adds;
	int line_dels;
} diff_expects;

Vicent Marti committed
23
extern int diff_file_cb(
24
	const git_diff_delta *delta,
25 26
	float progress,
	void *cb_data);
27

Vicent Marti committed
28
extern int diff_hunk_cb(
29 30
	const git_diff_delta *delta,
	const git_diff_range *range,
31
	const char *header,
32 33
	size_t header_len,
	void *cb_data);
34

Vicent Marti committed
35
extern int diff_line_cb(
36 37
	const git_diff_delta *delta,
	const git_diff_range *range,
38 39
	char line_origin,
	const char *content,
40 41
	size_t content_len,
	void *cb_data);
42

Russell Belfer committed
43 44
extern int diff_foreach_via_iterator(
	git_diff_list *diff,
Vicent Marti committed
45 46
	git_diff_file_cb file_cb,
	git_diff_hunk_cb hunk_cb,
47 48
	git_diff_data_cb line_cb,
	void *data);
49 50

extern void diff_print(FILE *fp, git_diff_list *diff);
51