merge-recursive: porcelain messages for checkout
[git/git.git] / unpack-trees.h
CommitLineData
16da134b
JS
1#ifndef UNPACK_TREES_H
2#define UNPACK_TREES_H
3
ca885a4f
JH
4#define MAX_UNPACK_TREES 8
5
16da134b 6struct unpack_trees_options;
08aefc9e 7struct exclude_list;
16da134b
JS
8
9typedef int (*merge_fn_t)(struct cache_entry **src,
34110cd4 10 struct unpack_trees_options *options);
16da134b 11
08353ebb
MM
12enum unpack_trees_error_types {
13 ERROR_WOULD_OVERWRITE = 0,
14 ERROR_NOT_UPTODATE_FILE,
15 ERROR_NOT_UPTODATE_DIR,
16 ERROR_WOULD_LOSE_UNTRACKED,
17 ERROR_BIND_OVERLAP,
18 ERROR_SPARSE_NOT_UPTODATE_FILE,
19 ERROR_WOULD_LOSE_ORPHANED,
20 NB_UNPACK_TREES_ERROR_TYPES
8ccba008
JH
21};
22
16da134b 23struct unpack_trees_options {
5a56da58
SB
24 unsigned int reset,
25 merge,
26 update,
27 index_only,
28 nontrivial_merge,
29 trivial_merges_only,
30 verbose_update,
31 aggressive,
32 skip_unmerged,
33 initial_checkout,
34 diff_index_cached,
ba655da5 35 debug_unpack,
08aefc9e 36 skip_sparse_checkout,
5a56da58 37 gently;
16da134b 38 const char *prefix;
da165f47 39 int cache_bottom;
f8a9d428 40 struct dir_struct *dir;
16da134b 41 merge_fn_t fn;
08353ebb 42 const char *msgs[NB_UNPACK_TREES_ERROR_TYPES];
16da134b
JS
43
44 int head_idx;
45 int merge_size;
46
47 struct cache_entry *df_conflict_entry;
d1f2d7e8 48 void *unpack_data;
34110cd4
LT
49
50 struct index_state *dst_index;
32260ad5 51 struct index_state *src_index;
34110cd4 52 struct index_state result;
08aefc9e
NTND
53
54 struct exclude_list *el; /* for internal use */
16da134b
JS
55};
56
933bf40a 57extern int unpack_trees(unsigned n, struct tree_desc *t,
16da134b
JS
58 struct unpack_trees_options *options);
59
34110cd4
LT
60int threeway_merge(struct cache_entry **stages, struct unpack_trees_options *o);
61int twoway_merge(struct cache_entry **src, struct unpack_trees_options *o);
62int bind_merge(struct cache_entry **src, struct unpack_trees_options *o);
63int oneway_merge(struct cache_entry **src, struct unpack_trees_options *o);
076b0adc 64
16da134b 65#endif