From: Junio C Hamano Date: Mon, 5 Jun 2017 00:18:13 +0000 (+0900) Subject: Merge branch 'tb/pull-ff-rebase-autostash' X-Git-Tag: v2.14.0-rc0~105 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=35898eafab5dfd4ebc9daf2f4e422a1d4771954b;p=thirdparty%2Fgit.git Merge branch 'tb/pull-ff-rebase-autostash' "git pull --rebase --autostash" didn't auto-stash when the local history fast-forwards to the upstream. * tb/pull-ff-rebase-autostash: pull: ff --rebase --autostash works in dirty repo --- 35898eafab5dfd4ebc9daf2f4e422a1d4771954b diff --cc builtin/pull.c index 318c273eb3,42f0560252..da8b60fc85 --- a/builtin/pull.c +++ b/builtin/pull.c @@@ -862,16 -863,18 +863,18 @@@ int cmd_pull(int argc, const char **arg die(_("Cannot rebase onto multiple branches.")); if (opt_rebase) { - struct commit_list *list = NULL; - struct commit *merge_head, *head; - - head = lookup_commit_reference(&orig_head); - commit_list_insert(head, &list); - merge_head = lookup_commit_reference(&merge_heads.oid[0]); - if (is_descendant_of(merge_head, list)) { - /* we can fast-forward this without invoking rebase */ - opt_ff = "--ff-only"; - return run_merge(); + if (!autostash) { + struct commit_list *list = NULL; + struct commit *merge_head, *head; + - head = lookup_commit_reference(orig_head.hash); ++ head = lookup_commit_reference(&orig_head); + commit_list_insert(head, &list); - merge_head = lookup_commit_reference(merge_heads.oid[0].hash); ++ merge_head = lookup_commit_reference(&merge_heads.oid[0]); + if (is_descendant_of(merge_head, list)) { + /* we can fast-forward this without invoking rebase */ + opt_ff = "--ff-only"; + return run_merge(); + } } return run_rebase(&curr_head, merge_heads.oid, &rebase_fork_point); } else {