5 #include "string-list.h"
7 #define MAX_UNPACK_TREES 8
9 struct unpack_trees_options
;
12 typedef int (*merge_fn_t
)(const struct cache_entry
* const *src
,
13 struct unpack_trees_options
*options
);
15 enum unpack_trees_error_types
{
16 ERROR_WOULD_OVERWRITE
= 0,
17 ERROR_NOT_UPTODATE_FILE
,
18 ERROR_NOT_UPTODATE_DIR
,
19 ERROR_WOULD_LOSE_UNTRACKED_OVERWRITTEN
,
20 ERROR_WOULD_LOSE_UNTRACKED_REMOVED
,
22 ERROR_SPARSE_NOT_UPTODATE_FILE
,
23 ERROR_WOULD_LOSE_ORPHANED_OVERWRITTEN
,
24 ERROR_WOULD_LOSE_ORPHANED_REMOVED
,
25 ERROR_WOULD_LOSE_SUBMODULE
,
26 NB_UNPACK_TREES_ERROR_TYPES
30 * Sets the list of user-friendly error messages to be used by the
31 * command "cmd" (either merge or checkout), and show_all_errors to 1.
33 void setup_unpack_trees_porcelain(struct unpack_trees_options
*opts
,
36 struct unpack_trees_options
{
56 struct dir_struct
*dir
;
57 struct pathspec
*pathspec
;
59 const char *msgs
[NB_UNPACK_TREES_ERROR_TYPES
];
61 * Store error messages in an array, each case
62 * corresponding to a error message type
64 struct string_list unpack_rejects
[NB_UNPACK_TREES_ERROR_TYPES
];
69 struct cache_entry
*df_conflict_entry
;
72 struct index_state
*dst_index
;
73 struct index_state
*src_index
;
74 struct index_state result
;
76 struct exclude_list
*el
; /* for internal use */
79 extern int unpack_trees(unsigned n
, struct tree_desc
*t
,
80 struct unpack_trees_options
*options
);
82 int verify_uptodate(const struct cache_entry
*ce
,
83 struct unpack_trees_options
*o
);
85 int threeway_merge(const struct cache_entry
* const *stages
,
86 struct unpack_trees_options
*o
);
87 int twoway_merge(const struct cache_entry
* const *src
,
88 struct unpack_trees_options
*o
);
89 int bind_merge(const struct cache_entry
* const *src
,
90 struct unpack_trees_options
*o
);
91 int oneway_merge(const struct cache_entry
* const *src
,
92 struct unpack_trees_options
*o
);