4 #include "string-list.h"
6 #define MAX_UNPACK_TREES 8
8 struct unpack_trees_options;
11 typedef int (*merge_fn_t)(const struct cache_entry * const *src,
12 struct unpack_trees_options *options);
14 enum unpack_trees_error_types {
15 ERROR_WOULD_OVERWRITE = 0,
16 ERROR_NOT_UPTODATE_FILE,
17 ERROR_NOT_UPTODATE_DIR,
18 ERROR_WOULD_LOSE_UNTRACKED_OVERWRITTEN,
19 ERROR_WOULD_LOSE_UNTRACKED_REMOVED,
21 ERROR_SPARSE_NOT_UPTODATE_FILE,
22 ERROR_WOULD_LOSE_ORPHANED_OVERWRITTEN,
23 ERROR_WOULD_LOSE_ORPHANED_REMOVED,
24 ERROR_WOULD_LOSE_SUBMODULE,
25 NB_UNPACK_TREES_ERROR_TYPES
29 * Sets the list of user-friendly error messages to be used by the
30 * command "cmd" (either merge or checkout), and show_all_errors to 1.
32 void setup_unpack_trees_porcelain(struct unpack_trees_options *opts,
35 struct unpack_trees_options {
55 struct dir_struct *dir;
56 struct pathspec *pathspec;
58 const char *msgs[NB_UNPACK_TREES_ERROR_TYPES];
60 * Store error messages in an array, each case
61 * corresponding to a error message type
63 struct string_list unpack_rejects[NB_UNPACK_TREES_ERROR_TYPES];
68 struct cache_entry *df_conflict_entry;
71 struct index_state *dst_index;
72 struct index_state *src_index;
73 struct index_state result;
75 struct exclude_list *el; /* for internal use */
78 extern int unpack_trees(unsigned n, struct tree_desc *t,
79 struct unpack_trees_options *options);
81 int threeway_merge(const struct cache_entry * const *stages,
82 struct unpack_trees_options *o);
83 int twoway_merge(const struct cache_entry * const *src,
84 struct unpack_trees_options *o);
85 int bind_merge(const struct cache_entry * const *src,
86 struct unpack_trees_options *o);
87 int oneway_merge(const struct cache_entry * const *src,
88 struct unpack_trees_options *o);