diff options
| author | Elijah Newren <newren@gmail.com> | 2020-04-27 17:59:49 +0000 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2020-04-27 11:51:26 -0700 |
| commit | a35413c3785bf71e2c018691d6cd5f93638ba9ae (patch) | |
| tree | ea9e3eff8827e29bfe27c5d7f078d3b9323d6c6c /builtin/rebase.c | |
| parent | af6b65d45ef179ed52087e80cb089f6b2349f4ec (diff) | |
| download | git-a35413c3785bf71e2c018691d6cd5f93638ba9ae.tar.gz | |
rebase: display an error if --root and --fork-point are both provided
--root implies we want to rebase all commits since the beginning of
history. --fork-point means we want to use the reflog of the specified
upstream to find the best common ancestor between <upstream> and
<branch> and only rebase commits since that common ancestor. These
options are clearly contradictory, so throw an error (instead of
segfaulting on a NULL pointer) if both are specified.
Reported-by: Alexander Berg <alexander.berg@atos.net>
Documentation-by: Alban Gruin <alban.gruin@gmail.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/rebase.c')
| -rw-r--r-- | builtin/rebase.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/builtin/rebase.c b/builtin/rebase.c index bff53d5d16..287ac1aa21 100644 --- a/builtin/rebase.c +++ b/builtin/rebase.c @@ -1652,6 +1652,9 @@ int cmd_rebase(int argc, const char **argv, const char *prefix) die(_("cannot combine '--keep-base' with '--root'")); } + if (options.root && fork_point > 0) + die(_("cannot combine '--root' with '--fork-point'")); + if (action != ACTION_NONE && !in_progress) die(_("No rebase in progress?")); setenv(GIT_REFLOG_ACTION_ENVIRONMENT, "rebase", 0); |
