unpack-trees.hon commit Turn unpack_trees_options.msgs into an array + enum (08353eb)
   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,
  17        ERROR_BIND_OVERLAP,
  18        ERROR_SPARSE_NOT_UPTODATE_FILE,
  19        ERROR_WOULD_LOSE_ORPHANED,
  20        NB_UNPACK_TREES_ERROR_TYPES
  21};
  22
  23struct unpack_trees_options {
  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,
  35                     debug_unpack,
  36                     skip_sparse_checkout,
  37                     gently;
  38        const char *prefix;
  39        int cache_bottom;
  40        struct dir_struct *dir;
  41        merge_fn_t fn;
  42        const char *msgs[NB_UNPACK_TREES_ERROR_TYPES];
  43
  44        int head_idx;
  45        int merge_size;
  46
  47        struct cache_entry *df_conflict_entry;
  48        void *unpack_data;
  49
  50        struct index_state *dst_index;
  51        struct index_state *src_index;
  52        struct index_state result;
  53
  54        struct exclude_list *el; /* for internal use */
  55};
  56
  57extern int unpack_trees(unsigned n, struct tree_desc *t,
  58                struct unpack_trees_options *options);
  59
  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);
  64
  65#endif