]>
Commit | Line | Data |
---|---|---|
16da134b JS |
1 | #ifndef UNPACK_TREES_H |
2 | #define UNPACK_TREES_H | |
3 | ||
ca885a4f JH |
4 | #define MAX_UNPACK_TREES 8 |
5 | ||
16da134b | 6 | struct unpack_trees_options; |
08aefc9e | 7 | struct exclude_list; |
16da134b JS |
8 | |
9 | typedef int (*merge_fn_t)(struct cache_entry **src, | |
34110cd4 | 10 | struct unpack_trees_options *options); |
16da134b | 11 | |
8ccba008 JH |
12 | struct 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; | |
e800ec9d NTND |
18 | const char *sparse_not_uptodate_file; |
19 | const char *would_lose_orphaned; | |
8ccba008 JH |
20 | }; |
21 | ||
16da134b | 22 | struct unpack_trees_options { |
5a56da58 SB |
23 | unsigned int reset, |
24 | merge, | |
25 | update, | |
26 | index_only, | |
27 | nontrivial_merge, | |
28 | trivial_merges_only, | |
29 | verbose_update, | |
30 | aggressive, | |
31 | skip_unmerged, | |
32 | initial_checkout, | |
33 | diff_index_cached, | |
ba655da5 | 34 | debug_unpack, |
08aefc9e | 35 | skip_sparse_checkout, |
5a56da58 | 36 | gently; |
16da134b | 37 | const char *prefix; |
da165f47 | 38 | int cache_bottom; |
f8a9d428 | 39 | struct dir_struct *dir; |
16da134b | 40 | merge_fn_t fn; |
8ccba008 | 41 | struct unpack_trees_error_msgs msgs; |
16da134b JS |
42 | |
43 | int head_idx; | |
44 | int merge_size; | |
45 | ||
46 | struct cache_entry *df_conflict_entry; | |
d1f2d7e8 | 47 | void *unpack_data; |
34110cd4 LT |
48 | |
49 | struct index_state *dst_index; | |
32260ad5 | 50 | struct index_state *src_index; |
34110cd4 | 51 | struct index_state result; |
08aefc9e NTND |
52 | |
53 | struct exclude_list *el; /* for internal use */ | |
16da134b JS |
54 | }; |
55 | ||
933bf40a | 56 | extern int unpack_trees(unsigned n, struct tree_desc *t, |
16da134b JS |
57 | struct unpack_trees_options *options); |
58 | ||
34110cd4 LT |
59 | int threeway_merge(struct cache_entry **stages, struct unpack_trees_options *o); |
60 | int twoway_merge(struct cache_entry **src, struct unpack_trees_options *o); | |
61 | int bind_merge(struct cache_entry **src, struct unpack_trees_options *o); | |
62 | int oneway_merge(struct cache_entry **src, struct unpack_trees_options *o); | |
076b0adc | 63 | |
16da134b | 64 | #endif |