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>
This commit is contained in:
Matthieu Moy 2010-09-02 13:57:34 +02:00 committed by Junio C Hamano
parent dc1166e685
commit e294030fe8
5 changed files with 8 additions and 5 deletions

View File

@ -373,7 +373,7 @@ static int merge_working_tree(struct checkout_opts *opts,
topts.src_index = &the_index; topts.src_index = &the_index;
topts.dst_index = &the_index; topts.dst_index = &the_index;
setup_unpack_trees_porcelain(topts.msgs, "checkout"); setup_unpack_trees_porcelain(&topts, "checkout");
refresh_cache(REFRESH_QUIET); refresh_cache(REFRESH_QUIET);

View File

@ -705,7 +705,7 @@ int checkout_fast_forward(const unsigned char *head, const unsigned char *remote
opts.merge = 1; opts.merge = 1;
opts.fn = twoway_merge; opts.fn = twoway_merge;
opts.show_all_errors = 1; opts.show_all_errors = 1;
setup_unpack_trees_porcelain(opts.msgs, "merge"); setup_unpack_trees_porcelain(&opts, "merge");
trees[nr_trees] = parse_tree_indirect(head); trees[nr_trees] = parse_tree_indirect(head);
if (!trees[nr_trees++]) if (!trees[nr_trees++])

View File

@ -185,7 +185,7 @@ static int git_merge_trees(int index_only,
opts.fn = threeway_merge; opts.fn = threeway_merge;
opts.src_index = &the_index; opts.src_index = &the_index;
opts.dst_index = &the_index; opts.dst_index = &the_index;
setup_unpack_trees_porcelain(opts.msgs, "merge"); setup_unpack_trees_porcelain(&opts, "merge");
init_tree_desc_from_tree(t+0, common); init_tree_desc_from_tree(t+0, common);
init_tree_desc_from_tree(t+1, head); init_tree_desc_from_tree(t+1, head);

View File

@ -50,8 +50,10 @@ const char *unpack_plumbing_errors[NB_UNPACK_TREES_ERROR_TYPES] = {
? ((o)->msgs[(type)]) \ ? ((o)->msgs[(type)]) \
: (unpack_plumbing_errors[(type)]) ) : (unpack_plumbing_errors[(type)]) )
void setup_unpack_trees_porcelain(const char **msgs, const char *cmd) void setup_unpack_trees_porcelain(struct unpack_trees_options *opts,
const char *cmd)
{ {
const char **msgs = opts->msgs;
const char *msg; const char *msg;
char *tmp; char *tmp;
const char *cmd2 = strcmp(cmd, "checkout") ? cmd : "switch branches"; const char *cmd2 = strcmp(cmd, "checkout") ? cmd : "switch branches";

View File

@ -26,7 +26,8 @@ enum unpack_trees_error_types {
* Sets the list of user-friendly error messages to be used by the * Sets the list of user-friendly error messages to be used by the
* command "cmd" (either merge or checkout) * command "cmd" (either merge or checkout)
*/ */
void setup_unpack_trees_porcelain(const char **msgs, const char *cmd); void setup_unpack_trees_porcelain(struct unpack_trees_options *opts,
const char *cmd);
struct rejected_paths_list { struct rejected_paths_list {
char *path; char *path;