5c9e98a666b2004eec37b4bc3b2d918fc2eb4e9f
   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
  12struct unpack_trees_error_msgs {
  13        const char *would_overwrite;
  14        const char *not_uptodate_file;
  15        const char *not_uptodate_dir;
  16        const char *would_lose_untracked;
  17        const char *bind_overlap;
  18};
  19
  20struct unpack_trees_options {
  21        unsigned int reset,
  22                     merge,
  23                     update,
  24                     index_only,
  25                     nontrivial_merge,
  26                     trivial_merges_only,
  27                     verbose_update,
  28                     aggressive,
  29                     skip_unmerged,
  30                     initial_checkout,
  31                     diff_index_cached,
  32                     skip_sparse_checkout,
  33                     gently;
  34        const char *prefix;
  35        int pos;
  36        struct dir_struct *dir;
  37        merge_fn_t fn;
  38        struct unpack_trees_error_msgs msgs;
  39
  40        int head_idx;
  41        int merge_size;
  42
  43        struct cache_entry *df_conflict_entry;
  44        void *unpack_data;
  45
  46        struct index_state *dst_index;
  47        struct index_state *src_index;
  48        struct index_state result;
  49
  50        struct exclude_list *el; /* for internal use */
  51};
  52
  53extern int unpack_trees(unsigned n, struct tree_desc *t,
  54                struct unpack_trees_options *options);
  55
  56int threeway_merge(struct cache_entry **stages, struct unpack_trees_options *o);
  57int twoway_merge(struct cache_entry **src, struct unpack_trees_options *o);
  58int bind_merge(struct cache_entry **src, struct unpack_trees_options *o);
  59int oneway_merge(struct cache_entry **src, struct unpack_trees_options *o);
  60
  61#endif