@matheusbsbs / matheus-bagliano / commits / e294030fe8
Fork 0

setup_unpack_trees_porcelain: take the whole options struct as parameter

This is a preparation patch to let setup_unpack_trees_porcelain set show_all_errors itself. Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Matthieu Moy committed Sep 2, 2010 at 13:57 UTC e294030fe89efcdd92430b60cf9568ffbe7317a8
5 files changed +8 -5
builtin/checkout.c
+1 -1
@@ -373,7 +373,7 @@ static int merge_working_tree(struct checkout_opts *opts,
373 topts.src_index = &the_index;
374 topts.dst_index = &the_index;
375
376 - setup_unpack_trees_porcelain(topts.msgs, "checkout");
376 + setup_unpack_trees_porcelain(&topts, "checkout");
377
378 refresh_cache(REFRESH_QUIET);
379
builtin/merge.c
+1 -1
@@ -705,7 +705,7 @@ int checkout_fast_forward(const unsigned char *head, const unsigned char *remote
705 opts.merge = 1;
706 opts.fn = twoway_merge;
707 opts.show_all_errors = 1;
708 - setup_unpack_trees_porcelain(opts.msgs, "merge");
708 + setup_unpack_trees_porcelain(&opts, "merge");
709
710 trees[nr_trees] = parse_tree_indirect(head);
711 if (!trees[nr_trees++])
merge-recursive.c
+1 -1
@@ -185,7 +185,7 @@ static int git_merge_trees(int index_only,
185 opts.fn = threeway_merge;
186 opts.src_index = &the_index;
187 opts.dst_index = &the_index;
188 - setup_unpack_trees_porcelain(opts.msgs, "merge");
188 + setup_unpack_trees_porcelain(&opts, "merge");
189
190 init_tree_desc_from_tree(t+0, common);
191 init_tree_desc_from_tree(t+1, head);
unpack-trees.c
+3 -1
@@ -50,8 +50,10 @@ const char *unpack_plumbing_errors[NB_UNPACK_TREES_ERROR_TYPES] = {
50 ? ((o)->msgs[(type)]) \
51 : (unpack_plumbing_errors[(type)]) )
52
53 -void setup_unpack_trees_porcelain(const char **msgs, const char *cmd)
53 +void setup_unpack_trees_porcelain(struct unpack_trees_options *opts,
54 + const char *cmd)
55 {
56 + const char **msgs = opts->msgs;
57 const char *msg;
58 char *tmp;
59 const char *cmd2 = strcmp(cmd, "checkout") ? cmd : "switch branches";
unpack-trees.h
+2 -1
@@ -26,7 +26,8 @@ enum unpack_trees_error_types {
26 * Sets the list of user-friendly error messages to be used by the
27 * command "cmd" (either merge or checkout)
28 */
29 -void setup_unpack_trees_porcelain(const char **msgs, const char *cmd);
29 +void setup_unpack_trees_porcelain(struct unpack_trees_options *opts,
30 + const char *cmd);
31
32 struct rejected_paths_list {
33 char *path;