]>
Commit | Line | Data |
---|---|---|
bec65a5e ET |
1 | #ifndef INCLUDE_cl_merge_helpers_h__ |
2 | #define INCLUDE_cl_merge_helpers_h__ | |
3 | ||
4 | #include "merge.h" | |
5 | #include "git2/merge.h" | |
6 | ||
7 | struct merge_index_entry { | |
8 | uint16_t mode; | |
3b2cb2c9 | 9 | char oid_str[GIT_OID_HEXSZ+1]; |
bec65a5e ET |
10 | int stage; |
11 | char path[128]; | |
12 | }; | |
13 | ||
14 | struct merge_name_entry { | |
15 | char ancestor_path[128]; | |
16 | char our_path[128]; | |
17 | char their_path[128]; | |
18 | }; | |
19 | ||
20 | struct merge_index_with_status { | |
4e7c1560 ET |
21 | struct merge_index_entry entry; |
22 | unsigned int status; | |
bec65a5e ET |
23 | }; |
24 | ||
25 | struct merge_reuc_entry { | |
26 | char path[128]; | |
27 | unsigned int ancestor_mode; | |
28 | unsigned int our_mode; | |
29 | unsigned int their_mode; | |
3b2cb2c9 CS |
30 | char ancestor_oid_str[GIT_OID_HEXSZ+1]; |
31 | char our_oid_str[GIT_OID_HEXSZ+1]; | |
32 | char their_oid_str[GIT_OID_HEXSZ+1]; | |
bec65a5e ET |
33 | }; |
34 | ||
35 | struct merge_index_conflict_data { | |
36 | struct merge_index_with_status ancestor; | |
37 | struct merge_index_with_status ours; | |
38 | struct merge_index_with_status theirs; | |
22a2d3d5 | 39 | git_merge_diff_t change_type; |
bec65a5e ET |
40 | }; |
41 | ||
42 | int merge_trees_from_branches( | |
43 | git_index **index, git_repository *repo, | |
44 | const char *ours_name, const char *theirs_name, | |
5aa2ac6d | 45 | git_merge_options *opts); |
bec65a5e | 46 | |
eac938d9 ET |
47 | int merge_commits_from_branches( |
48 | git_index **index, git_repository *repo, | |
49 | const char *ours_name, const char *theirs_name, | |
5aa2ac6d | 50 | git_merge_options *opts); |
eac938d9 | 51 | |
d9fdee6e | 52 | int merge_branches(git_repository *repo, |
02105a27 | 53 | const char *ours_branch, const char *theirs_branch, |
5aa2ac6d | 54 | git_merge_options *merge_opts, git_checkout_options *checkout_opts); |
039db728 | 55 | |
bec65a5e ET |
56 | int merge_test_diff_list(git_merge_diff_list *diff_list, const struct merge_index_entry expected[], size_t expected_len); |
57 | ||
58 | int merge_test_merge_conflicts(git_vector *conflicts, const struct merge_index_conflict_data expected[], size_t expected_len); | |
59 | ||
60 | int merge_test_index(git_index *index, const struct merge_index_entry expected[], size_t expected_len); | |
61 | ||
62 | int merge_test_names(git_index *index, const struct merge_name_entry expected[], size_t expected_len); | |
63 | ||
64 | int merge_test_reuc(git_index *index, const struct merge_reuc_entry expected[], size_t expected_len); | |
65 | ||
66 | int merge_test_workdir(git_repository *repo, const struct merge_index_entry expected[], size_t expected_len); | |
67 | ||
68 | #endif |