]> git.ipfire.org Git - thirdparty/git.git/blame - unpack-trees.h
i18n: avoid parenthesized string as array initializer
[thirdparty/git.git] / unpack-trees.h
CommitLineData
16da134b
JS
1#ifndef UNPACK_TREES_H
2#define UNPACK_TREES_H
3
7980872d
CB
4#include "string-list.h"
5
ca885a4f
JH
6#define MAX_UNPACK_TREES 8
7
16da134b 8struct unpack_trees_options;
08aefc9e 9struct exclude_list;
16da134b
JS
10
11typedef int (*merge_fn_t)(struct cache_entry **src,
34110cd4 12 struct unpack_trees_options *options);
16da134b 13
08353ebb
MM
14enum unpack_trees_error_types {
15 ERROR_WOULD_OVERWRITE = 0,
16 ERROR_NOT_UPTODATE_FILE,
17 ERROR_NOT_UPTODATE_DIR,
08402b04
MM
18 ERROR_WOULD_LOSE_UNTRACKED_OVERWRITTEN,
19 ERROR_WOULD_LOSE_UNTRACKED_REMOVED,
08353ebb
MM
20 ERROR_BIND_OVERLAP,
21 ERROR_SPARSE_NOT_UPTODATE_FILE,
08402b04
MM
22 ERROR_WOULD_LOSE_ORPHANED_OVERWRITTEN,
23 ERROR_WOULD_LOSE_ORPHANED_REMOVED,
08353ebb 24 NB_UNPACK_TREES_ERROR_TYPES
8ccba008
JH
25};
26
dc1166e6
MM
27/*
28 * Sets the list of user-friendly error messages to be used by the
5e65ee35 29 * command "cmd" (either merge or checkout), and show_all_errors to 1.
dc1166e6 30 */
e294030f
MM
31void setup_unpack_trees_porcelain(struct unpack_trees_options *opts,
32 const char *cmd);
dc1166e6 33
16da134b 34struct unpack_trees_options {
5a56da58
SB
35 unsigned int reset,
36 merge,
37 update,
38 index_only,
39 nontrivial_merge,
40 trivial_merges_only,
41 verbose_update,
42 aggressive,
43 skip_unmerged,
44 initial_checkout,
45 diff_index_cached,
ba655da5 46 debug_unpack,
08aefc9e 47 skip_sparse_checkout,
e6c111b4
MM
48 gently,
49 show_all_errors;
16da134b 50 const char *prefix;
da165f47 51 int cache_bottom;
f8a9d428 52 struct dir_struct *dir;
16da134b 53 merge_fn_t fn;
08353ebb 54 const char *msgs[NB_UNPACK_TREES_ERROR_TYPES];
e6c111b4
MM
55 /*
56 * Store error messages in an array, each case
57 * corresponding to a error message type
58 */
7980872d 59 struct string_list unpack_rejects[NB_UNPACK_TREES_ERROR_TYPES];
16da134b
JS
60
61 int head_idx;
62 int merge_size;
63
64 struct cache_entry *df_conflict_entry;
d1f2d7e8 65 void *unpack_data;
34110cd4
LT
66
67 struct index_state *dst_index;
32260ad5 68 struct index_state *src_index;
34110cd4 69 struct index_state result;
08aefc9e
NTND
70
71 struct exclude_list *el; /* for internal use */
16da134b
JS
72};
73
933bf40a 74extern int unpack_trees(unsigned n, struct tree_desc *t,
16da134b
JS
75 struct unpack_trees_options *options);
76
34110cd4
LT
77int threeway_merge(struct cache_entry **stages, struct unpack_trees_options *o);
78int twoway_merge(struct cache_entry **src, struct unpack_trees_options *o);
79int bind_merge(struct cache_entry **src, struct unpack_trees_options *o);
80int oneway_merge(struct cache_entry **src, struct unpack_trees_options *o);
076b0adc 81
16da134b 82#endif