1#ifndef UNPACK_TREES_H
2#define UNPACK_TREES_H
3
4#define MAX_UNPACK_TREES 8
5
6struct unpack_trees_options;
7
8typedef int (*merge_fn_t)(struct cache_entry **src,
9 struct unpack_trees_options *options);
10
11struct unpack_trees_error_msgs {
12 const char *would_overwrite;
13 const char *not_uptodate_file;
14 const char *not_uptodate_dir;
15 const char *would_lose_untracked;
16 const char *bind_overlap;
17};
18
19struct unpack_trees_options {
20 unsigned int reset,
21 merge,
22 update,
23 index_only,
24 nontrivial_merge,
25 trivial_merges_only,
26 verbose_update,
27 aggressive,
28 skip_unmerged,
29 initial_checkout,
30 diff_index_cached,
31 debug_unpack,
32 gently;
33 const char *prefix;
34 int cache_bottom;
35 struct dir_struct *dir;
36 merge_fn_t fn;
37 struct unpack_trees_error_msgs msgs;
38
39 int head_idx;
40 int merge_size;
41
42 struct cache_entry *df_conflict_entry;
43 void *unpack_data;
44
45 struct index_state *dst_index;
46 struct index_state *src_index;
47 struct index_state result;
48};
49
50extern int unpack_trees(unsigned n, struct tree_desc *t,
51 struct unpack_trees_options *options);
52
53int threeway_merge(struct cache_entry **stages, struct unpack_trees_options *o);
54int twoway_merge(struct cache_entry **src, struct unpack_trees_options *o);
55int bind_merge(struct cache_entry **src, struct unpack_trees_options *o);
56int oneway_merge(struct cache_entry **src, struct unpack_trees_options *o);
57
58#endif