run-command.c: remove run_command_v_opt_cd()
[git] / unpack-trees.h
1 #ifndef UNPACK_TREES_H
2 #define UNPACK_TREES_H
3
4 #define MAX_UNPACK_TREES 8
5
6 struct unpack_trees_options;
7
8 typedef int (*merge_fn_t)(struct cache_entry **src,
9                 struct unpack_trees_options *options);
10
11 struct 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
19 struct unpack_trees_options {
20         unsigned int reset:1,
21                      merge:1,
22                      update:1,
23                      index_only:1,
24                      nontrivial_merge:1,
25                      trivial_merges_only:1,
26                      verbose_update:1,
27                      aggressive:1,
28                      skip_unmerged:1,
29                      initial_checkout:1,
30                      gently:1;
31         const char *prefix;
32         int pos;
33         struct dir_struct *dir;
34         merge_fn_t fn;
35         struct unpack_trees_error_msgs msgs;
36
37         int head_idx;
38         int merge_size;
39
40         struct cache_entry *df_conflict_entry;
41         void *unpack_data;
42
43         struct index_state *dst_index;
44         struct index_state *src_index;
45         struct index_state result;
46 };
47
48 extern int unpack_trees(unsigned n, struct tree_desc *t,
49                 struct unpack_trees_options *options);
50
51 int threeway_merge(struct cache_entry **stages, struct unpack_trees_options *o);
52 int twoway_merge(struct cache_entry **src, struct unpack_trees_options *o);
53 int bind_merge(struct cache_entry **src, struct unpack_trees_options *o);
54 int oneway_merge(struct cache_entry **src, struct unpack_trees_options *o);
55
56 #endif