merge-recursive: move the global obuf to struct merge_options
[git/git.git] / merge-recursive.h
CommitLineData
e1b3a2ca
DB
1#ifndef MERGE_RECURSIVE_H
2#define MERGE_RECURSIVE_H
3
8a2fce18
MV
4struct merge_options {
5 const char *branch1;
6 const char *branch2;
7 unsigned subtree_merge : 1;
8 unsigned buffer_output : 1;
9 int verbosity;
10 int diff_rename_limit;
11 int merge_rename_limit;
5033639c 12 int call_depth;
c7d84924 13 struct strbuf obuf;
8a2fce18
MV
14};
15
16/* merge_trees() but with recursive ancestor consolidation */
17int merge_recursive(struct merge_options *o,
18 struct commit *h1,
e1b3a2ca 19 struct commit *h2,
e1b3a2ca
DB
20 struct commit_list *ancestors,
21 struct commit **result);
22
8a2fce18
MV
23/* rename-detecting three-way merge, no recursion */
24int merge_trees(struct merge_options *o,
25 struct tree *head,
e1b3a2ca
DB
26 struct tree *merge,
27 struct tree *common,
e1b3a2ca 28 struct tree **result);
e1b3a2ca 29
8a2fce18
MV
30/*
31 * "git-merge-recursive" can be fed trees; wrap them into
32 * virtual commits and call merge_recursive() proper.
33 */
34int merge_recursive_generic(struct merge_options *o,
35 const unsigned char *head,
36 const unsigned char *merge,
37 int num_ca,
38 const unsigned char **ca,
39 struct commit **result);
40
41void init_merge_options(struct merge_options *o);
42struct tree *write_tree_from_memory(struct merge_options *o);
9047ebbc 43
e1b3a2ca 44#endif