forked from AndreyG/libgit2cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdiff_list.h
More file actions
66 lines (50 loc) · 1.77 KB
/
Copy pathdiff_list.h
File metadata and controls
66 lines (50 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#pragma once
#include <functional>
extern "C"
{
#include <git2/diff.h>
}
namespace git
{
struct DiffList
{
size_t deltas_num() const;
typedef std::function<int ( git_diff_delta const *
, git_diff_range const *
, char usage
, const char * line
, size_t line_len
) > data_callback_t;
void print_patch (data_callback_t cb) const;
void print_compact (data_callback_t cb) const;
void print_raw (data_callback_t cb) const;
void find_similar(git_diff_find_options & findopts)
{
git_diff_find_similar(diff_list_, &findopts);
}
DiffList& merge(DiffList const & other);
explicit DiffList(git_diff_list * diff_list)
: diff_list_(diff_list)
{}
~DiffList() { git_diff_list_free(diff_list_); }
DiffList (DiffList const &) = delete;
DiffList& operator = (DiffList const &) = delete;
DiffList(DiffList && other)
: diff_list_(other.diff_list_)
{
other.diff_list_ = nullptr;
}
private:
git_diff_list * diff_list_;
};
struct Tree;
DiffList diff ( git_repository * repo
, Tree & a, Tree & b
, git_diff_options const & opts
);
DiffList diff_to_index ( git_repository * repo
, Tree &
, git_diff_options const & opts
);
DiffList diff_index_to_workdir(git_repository * repo, git_diff_options const & opts);
}