builtin.h: Move two functions definitions to help.h.
[git/mingw.git] / unpack-trees.h
blob6e049b09977cf89eca87f5ef22e645dd2027e414
1 #ifndef UNPACK_TREES_H
2 #define UNPACK_TREES_H
4 #define MAX_UNPACK_TREES 8
6 struct unpack_trees_options;
7 struct exclude_list;
9 typedef int (*merge_fn_t)(struct cache_entry **src,
10 struct unpack_trees_options *options);
12 enum 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
25 struct rejected_paths_list {
26 char *path;
27 struct rejected_paths_list *next;
30 struct unpack_trees_options {
31 unsigned int reset,
32 merge,
33 update,
34 index_only,
35 nontrivial_merge,
36 trivial_merges_only,
37 verbose_update,
38 aggressive,
39 skip_unmerged,
40 initial_checkout,
41 diff_index_cached,
42 debug_unpack,
43 skip_sparse_checkout,
44 gently,
45 show_all_errors;
46 const char *prefix;
47 int cache_bottom;
48 struct dir_struct *dir;
49 merge_fn_t fn;
50 const char *msgs[NB_UNPACK_TREES_ERROR_TYPES];
52 * Store error messages in an array, each case
53 * corresponding to a error message type
55 struct rejected_paths_list *unpack_rejects[NB_UNPACK_TREES_ERROR_TYPES];
57 int head_idx;
58 int merge_size;
60 struct cache_entry *df_conflict_entry;
61 void *unpack_data;
63 struct index_state *dst_index;
64 struct index_state *src_index;
65 struct index_state result;
67 struct exclude_list *el; /* for internal use */
70 extern int unpack_trees(unsigned n, struct tree_desc *t,
71 struct unpack_trees_options *options);
73 int threeway_merge(struct cache_entry **stages, struct unpack_trees_options *o);
74 int twoway_merge(struct cache_entry **src, struct unpack_trees_options *o);
75 int bind_merge(struct cache_entry **src, struct unpack_trees_options *o);
76 int oneway_merge(struct cache_entry **src, struct unpack_trees_options *o);
78 #endif