@@ -944,7 +944,6 @@ int cmd_pull(int argc, const char **argv, const char *prefix)
struct oid_array merge_heads = OID_ARRAY_INIT;
struct object_id orig_head, curr_head;
struct object_id rebase_fork_point;
- int autostash;
if (!getenv("GIT_REFLOG_ACTION"))
set_reflog_message(argc, argv);
@@ -977,8 +976,8 @@ int cmd_pull(int argc, const char **argv, const char *prefix)
if (get_oid("HEAD", &orig_head))
oidclr(&orig_head);
- autostash = config_autostash;
if (opt_rebase) {
+ int autostash = config_autostash;
if (opt_autostash != -1)
autostash = opt_autostash;
@@ -1053,13 +1052,11 @@ int cmd_pull(int argc, const char **argv, const char *prefix)
recurse_submodules == RECURSE_SUBMODULES_ON_DEMAND) &&
submodule_touches_in_range(the_repository, &upstream, &curr_head))
die(_("cannot rebase with locally recorded submodule modifications"));
- if (!autostash) {
- if (get_can_ff(&orig_head, &merge_heads.oid[0])) {
- /* we can fast-forward this without invoking rebase */
- opt_ff = "--ff-only";
- ran_ff = 1;
- ret = run_merge();
- }
+ if (get_can_ff(&orig_head, &merge_heads.oid[0])) {
+ /* we can fast-forward this without invoking rebase */
+ opt_ff = "--ff-only";
+ ran_ff = 1;
+ ret = run_merge();
}
if (!ran_ff)
ret = run_rebase(&newbase, &upstream);