Skip to content

Commit e294030

Browse files
moygitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent dc1166e commit e294030

File tree

5 files changed

+8
-5
lines changed

5 files changed

+8
-5
lines changed

builtin/checkout.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ static int merge_working_tree(struct checkout_opts *opts,
373373
topts.src_index = &the_index;
374374
topts.dst_index = &the_index;
375375

376-
setup_unpack_trees_porcelain(topts.msgs, "checkout");
376+
setup_unpack_trees_porcelain(&topts, "checkout");
377377

378378
refresh_cache(REFRESH_QUIET);
379379

builtin/merge.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ int checkout_fast_forward(const unsigned char *head, const unsigned char *remote
705705
opts.merge = 1;
706706
opts.fn = twoway_merge;
707707
opts.show_all_errors = 1;
708-
setup_unpack_trees_porcelain(opts.msgs, "merge");
708+
setup_unpack_trees_porcelain(&opts, "merge");
709709

710710
trees[nr_trees] = parse_tree_indirect(head);
711711
if (!trees[nr_trees++])

merge-recursive.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ static int git_merge_trees(int index_only,
185185
opts.fn = threeway_merge;
186186
opts.src_index = &the_index;
187187
opts.dst_index = &the_index;
188-
setup_unpack_trees_porcelain(opts.msgs, "merge");
188+
setup_unpack_trees_porcelain(&opts, "merge");
189189

190190
init_tree_desc_from_tree(t+0, common);
191191
init_tree_desc_from_tree(t+1, head);

unpack-trees.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,10 @@ const char *unpack_plumbing_errors[NB_UNPACK_TREES_ERROR_TYPES] = {
5050
? ((o)->msgs[(type)]) \
5151
: (unpack_plumbing_errors[(type)]) )
5252

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)
5455
{
56+
const char **msgs = opts->msgs;
5557
const char *msg;
5658
char *tmp;
5759
const char *cmd2 = strcmp(cmd, "checkout") ? cmd : "switch branches";

unpack-trees.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ enum unpack_trees_error_types {
2626
* Sets the list of user-friendly error messages to be used by the
2727
* command "cmd" (either merge or checkout)
2828
*/
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);
3031

3132
struct rejected_paths_list {
3233
char *path;

0 commit comments

Comments
 (0)