From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-3.6 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 0650B1FB0D for ; Wed, 25 Nov 2020 03:31:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727392AbgKYD3p (ORCPT ); Tue, 24 Nov 2020 22:29:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725876AbgKYD3o (ORCPT ); Tue, 24 Nov 2020 22:29:44 -0500 Received: from mail-ot1-x344.google.com (mail-ot1-x344.google.com [IPv6:2607:f8b0:4864:20::344]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2C7BC0613D6 for ; Tue, 24 Nov 2020 19:29:44 -0800 (PST) Received: by mail-ot1-x344.google.com with SMTP id 79so975977otc.7 for ; Tue, 24 Nov 2020 19:29:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Op5vJWDDN2Q3cMBDBTBcU4vctNwMOESdbcvnV8xMkeo=; b=IfER16YDNWK6OAFKyKaRua1bhMAy0syVW6/gDpG0kjHdXK6njMa9i1rOvIgJ59nbqX 3w2qf9PCF/j6+bLL3lP50o6HivX2pZO3Z+7pL3C+TIquTpcpJ+jvEnJ/pDOOGivIh7qz qmV4RlFJVkQ9OUGzfKp0IXNeQq0WRqfoYLTcPF7L0clicL3KArTmfIVlOlAf/D88gc9y lm4cVZlzwYzac/w/ozcAXvpeJjl/eNj3Jqh2pcQBRPJ3a9vo+GkYRsPUwwMe8fF8DY1B h5+omQk1VErFUehS8E/0WkpFWsQeSO+UDh4l2kzJhJBeflHcqI3/JSvHPQVaDE6nsu2N niJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Op5vJWDDN2Q3cMBDBTBcU4vctNwMOESdbcvnV8xMkeo=; b=OJts3owPJ1UGu8yYp5WqwmPr9UVpIKXK2sGUWjeqcZ/Y0nZpuvwOUC262Eyfg/A2GJ XTELFeht4v4IsVjVtmzmncXIHw+mvTCQ+v0OI5AeccayMXVv49pj/2ji9/haw/b8Wywt dv53TDL2iwpoQSWynRanpIgZAZ+44T5KVfay2oQMLEY6U8RwidgDRXXfaZs/yO4TPTPR ZC1BMHkx/HuXUyBGNGEuFNCMs3xZMUjt9Z8OrEbCZMOq0BVgAp97/TCiKfJkbi8N7WP9 +BFZZnAKp3BKJr/f2Iox/2SDQR83rHaaow8pzwFAK1RKwTV6Tn7x5k++Hs9e0roRxQYz MZxg== X-Gm-Message-State: AOAM532FeIWoAb0cpCmLH10dVclJnia64DUmLOzUWCCKiNbt1twFdH5q mVH5gd3sJS1EwaeM6Lbd0qiyX3z4MHw1lg== X-Google-Smtp-Source: ABdhPJxoQTQMCiZ4cwJ7owhA8a23NS9PwFqUWwqT3kHCKocZWF3oy1pw3nTZ8i24W33IqvBvXp9fsQ== X-Received: by 2002:a05:6830:3099:: with SMTP id f25mr1402732ots.77.1606274983852; Tue, 24 Nov 2020 19:29:43 -0800 (PST) Received: from localhost (189-209-26-110.static.axtel.net. [189.209.26.110]) by smtp.gmail.com with ESMTPSA id s28sm574817otd.2.2020.11.24.19.29.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Nov 2020 19:29:43 -0800 (PST) From: Felipe Contreras To: git@vger.kernel.org Cc: Alex Henrie , Jeff King , Junio C Hamano , Elijah Newren , Johannes Schindelin , John Keeping , Richard Hansen , Philip Oakley , "Brian M. Carlson" , "W. Trevor King" , Felipe Contreras Subject: [PATCH v8 02/10] pull: cleanup autostash check Date: Tue, 24 Nov 2020 21:29:30 -0600 Message-Id: <20201125032938.786393-3-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201125032938.786393-1-felipe.contreras@gmail.com> References: <20201125032938.786393-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org This essentially reverts commit f15e7cf5cc. Once commit d9f15d37f1 introduced the autostash option for the merge mode, it's not necessary to skip the fast-forward run_merge() when autostash is set. Signed-off-by: Felipe Contreras --- builtin/pull.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/builtin/pull.c b/builtin/pull.c index e2de0d4c91..eaa268c559 100644 --- a/builtin/pull.c +++ b/builtin/pull.c @@ -926,7 +926,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); @@ -959,8 +958,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; @@ -1029,13 +1028,11 @@ int cmd_pull(int argc, const char **argv, const char *prefix) recurse_submodules == RECURSE_SUBMODULES_ON_DEMAND) && submodule_touches_in_range(the_repository, &rebase_fork_point, &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(&curr_head, merge_heads.oid, &rebase_fork_point); -- 2.29.2