8be6b3cca90e13a80ca638f721f011731bb75402
1#ifndef UNPACK_TREES_H
2#define UNPACK_TREES_H
3
4#define MAX_UNPACK_TREES 8
5
6struct unpack_trees_options;
7struct exclude_list;
8
9typedef int (*merge_fn_t)(struct cache_entry **src,
10 struct unpack_trees_options *options);
11
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_OVERWRITTEN,
17 ERROR_WOULD_LOSE_UNTRACKED_REMOVED,
18 ERROR_BIND_OVERLAP,
19 ERROR_SPARSE_NOT_UPTODATE_FILE,
20 ERROR_WOULD_LOSE_ORPHANED_OVERWRITTEN,
21 ERROR_WOULD_LOSE_ORPHANED_REMOVED,
22 NB_UNPACK_TREES_ERROR_TYPES
23};
24
25struct unpack_trees_options {
26 unsigned int reset,
27 merge,
28 update,
29 index_only,
30 nontrivial_merge,
31 trivial_merges_only,
32 verbose_update,
33 aggressive,
34 skip_unmerged,
35 initial_checkout,
36 diff_index_cached,
37 debug_unpack,
38 skip_sparse_checkout,
39 gently;
40 const char *prefix;
41 int cache_bottom;
42 struct dir_struct *dir;
43 merge_fn_t fn;
44 const char *msgs[NB_UNPACK_TREES_ERROR_TYPES];
45
46 int head_idx;
47 int merge_size;
48
49 struct cache_entry *df_conflict_entry;
50 void *unpack_data;
51
52 struct index_state *dst_index;
53 struct index_state *src_index;
54 struct index_state result;
55
56 struct exclude_list *el; /* for internal use */
57};
58
59extern int unpack_trees(unsigned n, struct tree_desc *t,
60 struct unpack_trees_options *options);
61
62int threeway_merge(struct cache_entry **stages, struct unpack_trees_options *o);
63int twoway_merge(struct cache_entry **src, struct unpack_trees_options *o);
64int bind_merge(struct cache_entry **src, struct unpack_trees_options *o);
65int oneway_merge(struct cache_entry **src, struct unpack_trees_options *o);
66
67#endif