static int verbosity;
static int allow_rerere_auto;
static int abort_current_merge;
+static int show_progress = -1;
static struct strategy all_strategy[] = {
{ "recursive", DEFAULT_TWOHEAD | NO_TRIVIAL },
OPT__VERBOSITY(&verbosity),
OPT_BOOLEAN(0, "abort", &abort_current_merge,
"abort the current in-progress merge"),
+ OPT_SET_INT(0, "progress", &show_progress, "force progress reporting", 1),
OPT_END()
};
die("git write-tree failed to write a tree");
}
-int try_merge_command(const char *strategy, struct commit_list *common,
+int try_merge_command(const char *strategy, size_t xopts_nr,
+ const char **xopts, struct commit_list *common,
const char *head_arg, struct commit_list *remotes)
{
const char **args;
o.subtree_shift = "";
o.renormalize = option_renormalize;
+ o.show_rename_progress =
+ show_progress == -1 ? isatty(2) : show_progress;
for (x = 0; x < xopts_nr; x++)
if (parse_merge_opt(&o, xopts[x]))
rollback_lock_file(lock);
return clean ? 0 : 1;
} else {
- return try_merge_command(strategy, common, head_arg, remoteheads);
+ return try_merge_command(strategy, xopts_nr, xopts,
+ common, head_arg, remoteheads);
}
}
argc = parse_options(argc, argv, prefix, builtin_merge_options,
builtin_merge_usage, 0);
+ if (verbosity < 0 && show_progress == -1)
+ show_progress = 0;
+
if (abort_current_merge) {
int nargc = 2;
const char *nargv[] = {"reset", "--merge", NULL};
else
die("You have not concluded your merge (MERGE_HEAD exists).");
}
+ if (file_exists(git_path("CHERRY_PICK_HEAD"))) {
+ if (advice_resolve_conflict)
+ die("You have not concluded your cherry-pick (CHERRY_PICK_HEAD exists).\n"
+ "Please, commit your changes before you can merge.");
+ else
+ die("You have not concluded your cherry-pick (CHERRY_PICK_HEAD exists).");
+ }
resolve_undo_clear();
if (verbosity < 0)