Code

git merge -X<option>
[git.git] / merge-recursive.h
1 #ifndef MERGE_RECURSIVE_H
2 #define MERGE_RECURSIVE_H
4 #include "string-list.h"
6 struct merge_options {
7         const char *branch1;
8         const char *branch2;
9         enum {
10                 MERGE_RECURSIVE_SUBTREE = 1,
11                 MERGE_RECURSIVE_OURS,
12                 MERGE_RECURSIVE_THEIRS,
13         } recursive_variant;
14         unsigned buffer_output : 1;
15         int verbosity;
16         int diff_rename_limit;
17         int merge_rename_limit;
18         int call_depth;
19         struct strbuf obuf;
20         struct string_list current_file_set;
21         struct string_list current_directory_set;
22 };
24 /* merge_trees() but with recursive ancestor consolidation */
25 int merge_recursive(struct merge_options *o,
26                     struct commit *h1,
27                     struct commit *h2,
28                     struct commit_list *ancestors,
29                     struct commit **result);
31 /* rename-detecting three-way merge, no recursion */
32 int merge_trees(struct merge_options *o,
33                 struct tree *head,
34                 struct tree *merge,
35                 struct tree *common,
36                 struct tree **result);
38 /*
39  * "git-merge-recursive" can be fed trees; wrap them into
40  * virtual commits and call merge_recursive() proper.
41  */
42 int merge_recursive_generic(struct merge_options *o,
43                             const unsigned char *head,
44                             const unsigned char *merge,
45                             int num_ca,
46                             const unsigned char **ca,
47                             struct commit **result);
49 void init_merge_options(struct merge_options *o);
50 struct tree *write_tree_from_memory(struct merge_options *o);
52 #endif