diff_helpers.h 975 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 9 10 11

typedef struct {
	int files;
	int file_adds;
	int file_dels;
	int file_mods;
12 13
	int file_ignored;
	int file_untracked;
14
	int file_unmodified;
15 16 17 18 19 20 21 22 23

	int hunks;
	int hunk_new_lines;
	int hunk_old_lines;

	int lines;
	int line_ctxt;
	int line_adds;
	int line_dels;
24 25

	bool at_least_one_of_them_is_binary;
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
} diff_expects;

extern int diff_file_fn(
	void *cb_data,
	git_diff_delta *delta,
	float progress);

extern int diff_hunk_fn(
	void *cb_data,
	git_diff_delta *delta,
	git_diff_range *range,
	const char *header,
	size_t header_len);

extern int diff_line_fn(
	void *cb_data,
	git_diff_delta *delta,
43
	git_diff_range *range,
44 45 46
	char line_origin,
	const char *content,
	size_t content_len);
47

Russell Belfer committed
48 49 50 51 52 53
extern int diff_foreach_via_iterator(
	git_diff_list *diff,
	void *data,
	git_diff_file_fn file_cb,
	git_diff_hunk_fn hunk_cb,
	git_diff_data_fn line_cb);