summaryrefslogtreecommitdiff
path: root/builtin/rebase.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-07-11 22:16:48 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-07-11 22:16:48 (GMT)
commit64096fb41d36cf0e9808c9d15ae46ec364e5c800 (patch)
tree51a033877cfd78934642963ad968328580798813 /builtin/rebase.c
parentdf73cb38d942d2fb305a0fbfedd9a093ca386c83 (diff)
parent906b63942ac7f0ff904228b03d5dbe1edc59f0fe (diff)
downloadgit-64096fb41d36cf0e9808c9d15ae46ec364e5c800.zip
git-64096fb41d36cf0e9808c9d15ae46ec364e5c800.tar.gz
git-64096fb41d36cf0e9808c9d15ae46ec364e5c800.tar.bz2
Merge branch 'js/rebase-reschedule-applies-only-to-interactive'
The configuration variable rebase.rescheduleFailedExec should be effective only while running an interactive rebase and should not affect anything when running an non-interactive one, which was not the case. This has been corrected. * js/rebase-reschedule-applies-only-to-interactive: rebase --am: ignore rebase.rescheduleFailedExec
Diffstat (limited to 'builtin/rebase.c')
-rw-r--r--builtin/rebase.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/builtin/rebase.c b/builtin/rebase.c
index 3c7d8b8..89fc4b8 100644
--- a/builtin/rebase.c
+++ b/builtin/rebase.c
@@ -1389,6 +1389,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
struct string_list strategy_options = STRING_LIST_INIT_NODUP;
struct object_id squash_onto;
char *squash_onto_name = NULL;
+ int reschedule_failed_exec = -1;
struct option builtin_rebase_options[] = {
OPT_STRING(0, "onto", &options.onto_name,
N_("revision"),
@@ -1481,7 +1482,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
OPT_BOOL(0, "root", &options.root,
N_("rebase all reachable commits up to the root(s)")),
OPT_BOOL(0, "reschedule-failed-exec",
- &options.reschedule_failed_exec,
+ &reschedule_failed_exec,
N_("automatically re-schedule any `exec` that fails")),
OPT_END(),
};
@@ -1796,8 +1797,11 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
break;
}
- if (options.reschedule_failed_exec && !is_interactive(&options))
- die(_("%s requires an interactive rebase"), "--reschedule-failed-exec");
+ if (reschedule_failed_exec > 0 && !is_interactive(&options))
+ die(_("--reschedule-failed-exec requires "
+ "--exec or --interactive"));
+ if (reschedule_failed_exec >= 0)
+ options.reschedule_failed_exec = reschedule_failed_exec;
if (options.git_am_opts.argc) {
/* all am options except -q are compatible only with --am */