Merge branch 'pb/pull-rebase-autostash-fix'

"git pull --rebase" ignored the rebase.autostash configuration
variable when the remote history is a descendant of our history,
which has been corrected.

* pb/pull-rebase-autostash-fix:
  pull --rebase: honor rebase.autostash when fast-forwarding
This commit is contained in:
Junio C Hamano
2022-02-05 09:42:28 -08:00
2 changed files with 16 additions and 4 deletions

View File

@ -1038,14 +1038,13 @@ int cmd_pull(int argc, const char **argv, const char *prefix)
oidclr(&orig_head);
if (opt_rebase) {
int autostash = config_autostash;
if (opt_autostash != -1)
autostash = opt_autostash;
if (opt_autostash == -1)
opt_autostash = config_autostash;
if (is_null_oid(&orig_head) && !is_cache_unborn())
die(_("Updating an unborn branch with changes added to the index."));
if (!autostash)
if (!opt_autostash)
require_clean_work_tree(the_repository,
N_("pull with rebase"),
_("please commit or stash them."), 1, 0);