From patchwork Thu Apr 25 21:10:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 10917773 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E14E7912 for ; Thu, 25 Apr 2019 21:10:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D012728D37 for ; Thu, 25 Apr 2019 21:10:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C44F728D3A; Thu, 25 Apr 2019 21:10:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B582E28D37 for ; Thu, 25 Apr 2019 21:10:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731105AbfDYVKi (ORCPT ); Thu, 25 Apr 2019 17:10:38 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:41018 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726006AbfDYVKi (ORCPT ); Thu, 25 Apr 2019 17:10:38 -0400 Received: by mail-pg1-f196.google.com with SMTP id f6so451546pgs.8 for ; Thu, 25 Apr 2019 14:10:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=zCFwCon/q16ECc7OYA/3Nf/KElxKyNbEJ5u+FzbXmfU=; b=ZG6trilOfZup+ZmaHt+qrmkAN+lRLiGzIBIfAxDfTpa0AObP3Ko58XrX601fqkEZ6d Z3RdAEFfLKK4v3eXJYfqM1bxmkmfh/DQ+dV9tNCvuCOxasX94BlqH7aBW5fiZX4tQCNa GDU0ghr06FV8V7FaU3RdpEZ4OPfKLepY2xe6pMD1L9VDKFpnATkMZMYcVCiZFbPFa0wz 6jlVDLMxbZk7sLopbeIOzV1CaXXc+faU3X+8uaf4hLxudxAVBSPInyVUZAOzSpuxvnT7 LMsXXszKzjPzrpNnYqn2gCUQ+49CjwsKNDtmyCvPe/E6ZmTeTi7imsgZ7FajAjSc7k8F rHKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=zCFwCon/q16ECc7OYA/3Nf/KElxKyNbEJ5u+FzbXmfU=; b=XaK62k05aLLdEscdYSN3vm1hSsrX5mLxNtoS0AfeBpQa31gLouwrcNbnRtXeCprGQf RbsFG53PkTYGY47TNYWg8Q9BudJmBW4e4VFwTvs8+KtD7fg9eFSzoWqQOXfw9oop/q1x 9GlVCeuqYmB7DEYHVyO3l0RHOW4L2rXa9qAFvkSoW36+Y3LOIo0hxJEp7+pOsHiXFAaJ jbrPy4OGa2u7RbDiTIvbN6HKz7Xz5EHppu4rdUaxCmV00FEKhXVw6DPsN0upKLzWx0Ph UJCmj54XhTpQBg1ktVdhyAW7cIVeAZxbXwyb4BWMVvA5c3QDUPtIdN3DEoMx/VTY3kFR 6NOA== X-Gm-Message-State: APjAAAUPeURfVvFTrbaty4zOGSB4YG5CNNg9x2zPwgfQVY93Pj6fcels 1IGWlzoxrQl8j6kp0GwBQgyMIL8Z X-Google-Smtp-Source: APXvYqxL1M1UybcId8MQkavTKkk2J1ei1gixOKl+x6i73dmX+y0wkEwjNQGx15IasJ9cPQr0hKRr8g== X-Received: by 2002:a63:6e0e:: with SMTP id j14mr39705243pgc.203.1556226637096; Thu, 25 Apr 2019 14:10:37 -0700 (PDT) Received: from dev-l ([149.28.200.39]) by smtp.gmail.com with ESMTPSA id o14sm25668822pgn.4.2019.04.25.14.10.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Apr 2019 14:10:36 -0700 (PDT) Date: Thu, 25 Apr 2019 14:10:36 -0700 From: Denton Liu To: Git Mailing List Subject: [PATCH 1/3] t2018: cleanup in current test Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Before, in t2018, if do_checkout failed to create `branch2`, the next test-case would run `git branch -D branch2` but then fail because it was expecting `branch2` to exist, even though it doesn't. As a result, an early failure could cause a cascading failure of tests. Make test-case responsible for cleaning up their own branches so that future tests can start with a sane environment. Signed-off-by: Denton Liu --- t/t2018-checkout-branch.sh | 39 +++++++++++++------------------------- 1 file changed, 13 insertions(+), 26 deletions(-) diff --git a/t/t2018-checkout-branch.sh b/t/t2018-checkout-branch.sh index c5014ad9a6..fdb7fd282d 100755 --- a/t/t2018-checkout-branch.sh +++ b/t/t2018-checkout-branch.sh @@ -60,38 +60,36 @@ test_expect_success 'setup' ' ' test_expect_success 'checkout -b to a new branch, set to HEAD' ' + test_when_finished test_might_fail git branch -D branch2 && + test_when_finished git checkout branch1 && do_checkout branch2 ' test_expect_success 'checkout -b to a new branch, set to an explicit ref' ' - git checkout branch1 && - git branch -D branch2 && - + test_when_finished test_might_fail git branch -D branch2 && + test_when_finished git checkout branch1 && do_checkout branch2 $HEAD1 ' test_expect_success 'checkout -b to a new branch with unmergeable changes fails' ' - git checkout branch1 && - - # clean up from previous test - git branch -D branch2 && - setup_dirty_unmergeable && test_must_fail do_checkout branch2 $HEAD1 && test_dirty_unmergeable ' test_expect_success 'checkout -f -b to a new branch with unmergeable changes discards changes' ' + test_when_finished test_might_fail git branch -D branch2 && + test_when_finished git checkout branch1 && + # still dirty and on branch1 do_checkout branch2 $HEAD1 "-f -b" && test_must_fail test_dirty_unmergeable ' test_expect_success 'checkout -b to a new branch preserves mergeable changes' ' - git checkout branch1 && - - # clean up from previous test - git branch -D branch2 && + test_when_finished test_might_fail git branch -D branch2 && + test_when_finished git checkout branch1 && + test_when_finished git reset --hard && setup_dirty_mergeable && do_checkout branch2 $HEAD1 && @@ -99,27 +97,18 @@ test_expect_success 'checkout -b to a new branch preserves mergeable changes' ' ' test_expect_success 'checkout -f -b to a new branch with mergeable changes discards changes' ' - # clean up from previous test - git reset --hard && - - git checkout branch1 && - - # clean up from previous test - git branch -D branch2 && - + test_when_finished git reset --hard HEAD && setup_dirty_mergeable && do_checkout branch2 $HEAD1 "-f -b" && test_must_fail test_dirty_mergeable ' test_expect_success 'checkout -b to an existing branch fails' ' - git reset --hard HEAD && - + test_when_finished git reset --hard HEAD && test_must_fail do_checkout branch2 $HEAD2 ' test_expect_success 'checkout -b to @{-1} fails with the right branch name' ' - git reset --hard HEAD && git checkout branch1 && git checkout branch2 && echo >expect "fatal: A branch named '\''branch1'\'' already exists." && @@ -160,6 +149,7 @@ test_expect_success 'checkout -f -B to an existing branch with unmergeable chang ' test_expect_success 'checkout -B to an existing branch preserves mergeable changes' ' + test_when_finished git reset --hard && git checkout branch1 && setup_dirty_mergeable && @@ -168,9 +158,6 @@ test_expect_success 'checkout -B to an existing branch preserves mergeable chang ' test_expect_success 'checkout -f -B to an existing branch with mergeable changes discards changes' ' - # clean up from previous test - git reset --hard && - git checkout branch1 && setup_dirty_mergeable && From patchwork Thu Apr 25 21:10:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 10917775 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3A3761515 for ; Thu, 25 Apr 2019 21:10:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2905928D37 for ; Thu, 25 Apr 2019 21:10:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1D5EE28D3A; Thu, 25 Apr 2019 21:10:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BF58D28D37 for ; Thu, 25 Apr 2019 21:10:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387398AbfDYVKk (ORCPT ); Thu, 25 Apr 2019 17:10:40 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:34329 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726006AbfDYVKj (ORCPT ); Thu, 25 Apr 2019 17:10:39 -0400 Received: by mail-pf1-f194.google.com with SMTP id b3so545208pfd.1 for ; Thu, 25 Apr 2019 14:10:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=qSoNQaUaZqvH17VggX9DTUkgv6ddCZLRzNE1fkqgTLQ=; b=kShagk0N0IwgilGP2Gdv8oOr6Yz85rKncujxhntpccRsGAs9b3UqX6aRNOStQ589h5 NrgnAA0DwWLck0cioht/39Chi8n62SHrsIDXHTxrltUBwrcpUp7CespqTqXn+2nYUXYh NtZ9Ew5Z6kSlNiRttL65B5aBnVv06nwbbn4G5t9Tp6Lg7wtUCACrd+B/80jqYZ1V9lQb WE8qhyg7H8nB+ycfjxtecKNe42S6dvjYxiuPvPoM0QWk7yy+RqP0RM+cqEhOhDEELHQj 1M68uvaUHEYkW3jU7Kx0mQl4JgQyiEYn0boz6/rOfXtwxxRRodptBZMJ7TaqKzdOZABM vNIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=qSoNQaUaZqvH17VggX9DTUkgv6ddCZLRzNE1fkqgTLQ=; b=tgVbTRClhkUlLh3ypU77z/kJQJimU0VxeDaWr2ka08CZeYDSxbeOXqvbIm4O68XgWW 7ln7Pwjjte3K0CNZnin1+t5i2sEI1OUTKVidFIf1ATZu9L16pdiZAnvWRnbpF/Y61CzR wm5LYzQPNGQjuiEg7PbP5fqfeYofBkOpI+xYeTuewAuOZDjUkUNejyP93ONO3cgYScTZ MYjBlzsGWg5bJyWVNMTgVN1KcJmscHDNG9U9KJMX0I64auC40oJ1mi7j57ZeHn0osRhP hIaH7lNxygrwpPRQlhkEFufQRjVFkPfE68fv45JwpdvMk9IQQjcZ7AluX4kLdC9BneGS 4gzw== X-Gm-Message-State: APjAAAU4pCVOCLdBz1qwH0ScQ60Zm6Mymtsdd0qZtzRMTBz873a0FY3B k09bOdI3WNg4lZckL8uf+gsG8++v X-Google-Smtp-Source: APXvYqxmeHlLYRUt2LpZXO9dUoznfxXdTbXigElQddWc9MWGGfkhbnuL4Ori4jYCeJCzbqlUqZT/bA== X-Received: by 2002:a63:531a:: with SMTP id h26mr33331631pgb.428.1556226638280; Thu, 25 Apr 2019 14:10:38 -0700 (PDT) Received: from dev-l ([149.28.200.39]) by smtp.gmail.com with ESMTPSA id p2sm59250259pfi.73.2019.04.25.14.10.37 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Apr 2019 14:10:37 -0700 (PDT) Date: Thu, 25 Apr 2019 14:10:37 -0700 From: Denton Liu To: Git Mailing List Subject: [PATCH 2/3] t2018: demonstrate checkout -b merge base bug Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In git-checkout.txt, it states As a special case, you may use `"A...B"` as a shortcut for the merge base of `A` and `B` if there is exactly one merge base. You can leave out at most one of `A` and `B`, in which case it defaults to `HEAD`. However, there exists a bug where performing $ git checkout -b test master... fails with the message fatal: Not a valid object name: 'master...'. Demonstrate this failure so that it can be corrected later. Signed-off-by: Denton Liu --- t/t2018-checkout-branch.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/t/t2018-checkout-branch.sh b/t/t2018-checkout-branch.sh index fdb7fd282d..a3fa520d2e 100755 --- a/t/t2018-checkout-branch.sh +++ b/t/t2018-checkout-branch.sh @@ -65,6 +65,12 @@ test_expect_success 'checkout -b to a new branch, set to HEAD' ' do_checkout branch2 ' +test_expect_failure 'checkout -b to a merge base' ' + test_when_finished test_might_fail git branch -D branch2 && + test_when_finished git checkout branch1 && + git checkout -b branch2 branch1... +' + test_expect_success 'checkout -b to a new branch, set to an explicit ref' ' test_when_finished test_might_fail git branch -D branch2 && test_when_finished git checkout branch1 && @@ -122,6 +128,13 @@ test_expect_success 'checkout -B to an existing branch resets branch to HEAD' ' do_checkout branch2 "" -B ' +test_expect_failure 'checkout -B to a merge base' ' + git checkout branch1 && + git branch -D branch2 && + + git checkout -B branch2 branch1... +' + test_expect_success 'checkout -B to an existing branch from detached HEAD resets branch to HEAD' ' git checkout $(git rev-parse --verify HEAD) && From patchwork Thu Apr 25 21:10:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 10917777 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B07581515 for ; Thu, 25 Apr 2019 21:10:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A059128D37 for ; Thu, 25 Apr 2019 21:10:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 94C0328D3A; Thu, 25 Apr 2019 21:10:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3C78528D37 for ; Thu, 25 Apr 2019 21:10:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387409AbfDYVKl (ORCPT ); Thu, 25 Apr 2019 17:10:41 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:39944 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731106AbfDYVKk (ORCPT ); Thu, 25 Apr 2019 17:10:40 -0400 Received: by mail-pg1-f194.google.com with SMTP id d31so453086pgl.7 for ; Thu, 25 Apr 2019 14:10:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=GAfVTcg9qRRfX7MOW9Ezg6H3UYlLOOMajqSnr5dfvaQ=; b=jm/F9NKlyj7U3YfLMXamZavdpFlYZyG6fi0t67YaPYdcV28r6Sr8KShStUT3BquOeC vzS2nVBeoSskN5eYJUXjsp+pnCHlw/ZswM4mnIWnyA+YwV3zbahckMvx9euUZ/xO0iOh ydrn0FLkSroz7WXC+qy/IOGPIz7sys5C+OG//SzOcPy9xeL7zZsirG0luZ2S15/lAE38 ja7fd70hbO+pI2Pfu9pHcvzy3nqn9BzS0vLGTQREgK4MD7sapTxY8Rq4qrMabyxGUM7j 8D694capsk60/nevnKUp2tJsTnJ5C3qgGd+dcxqpMiCygUU2yyUUPz1p1WiR3+MgdWJZ Nhlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=GAfVTcg9qRRfX7MOW9Ezg6H3UYlLOOMajqSnr5dfvaQ=; b=aLw26P7exHHoshMP0c9gqseQSnMTUygUJp0X263l5iYoUQgnmnSwNV6+Z0qFW2sFIe TzWuiBOR+dhjD9OYEf4C9a2Gz3lxPQpxxPcKv5Dx2jEi+WQlx9lPxj6zZGyLkye+zY6n 5s/cjFlayR51VJglY5z8vE1PqOfYKVUc9l1rQ6MWStXbdPf9LGMeygSflEk/UJMC4dxL 1OZedKLatQ4d61KdHoDpwIPuYq9lK3TJ847C8KZmbwuiydZDu6Q0IUMZApmj+lD342pa epiPkotg02nNZhYv5pdN0qJj8tfjfeXVpemvJ6p9FOCFFeYxqi7t/DDJ77YYWge8DQpN IQ4g== X-Gm-Message-State: APjAAAVdIkpB3wV8SeRqxkMaAt4RPk48DWElmMMP6+J8tx6NCrWB6M1p mseV2ujUGx8HmtZ9MFLiz7jP73IK X-Google-Smtp-Source: APXvYqwowKHXs2HucxY1Uibynb2KFDF5VjPGK6WT8Yd9bTD3/CcVxFS+fPO96raXzCK/iFVehsD0Rg== X-Received: by 2002:a62:604:: with SMTP id 4mr42644527pfg.38.1556226639441; Thu, 25 Apr 2019 14:10:39 -0700 (PDT) Received: from dev-l ([149.28.200.39]) by smtp.gmail.com with ESMTPSA id a6sm34521551pfn.181.2019.04.25.14.10.38 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Apr 2019 14:10:38 -0700 (PDT) Date: Thu, 25 Apr 2019 14:10:38 -0700 From: Denton Liu To: Git Mailing List Subject: [PATCH 3/3] checkout: allow -b/-B to work on a merge base Message-ID: <031780431d790c16b3862d6f155693e197bb74ed.1556226502.git.liu.denton@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When we ran something like $ git checkout -b test master... it would fail with the message fatal: Not a valid object name: 'master...'. This was caused by the call to `create_branch` where `start_name` is expected to be a valid rev. However, git-checkout allows the branch to not be a valid rev in the case where we have "..." to specify getting the merge base. In the case where a branch with "..." is specified, use the oid instead so that `start_name` is a valid rev. Signed-off-by: Denton Liu --- builtin/checkout.c | 4 +++- t/t2018-checkout-branch.sh | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/builtin/checkout.c b/builtin/checkout.c index ffa776c6e1..d99b3f3925 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -1229,7 +1229,9 @@ static int parse_branchname_arg(int argc, const char **argv, argv++; argc--; - new_branch_info->name = arg; + new_branch_info->name = strstr(arg, "...") ? + xstrdup(oid_to_hex(rev)) : + arg; setup_branch_path(new_branch_info); if (!check_refname_format(new_branch_info->path, 0) && diff --git a/t/t2018-checkout-branch.sh b/t/t2018-checkout-branch.sh index a3fa520d2e..d6ea556d84 100755 --- a/t/t2018-checkout-branch.sh +++ b/t/t2018-checkout-branch.sh @@ -65,7 +65,7 @@ test_expect_success 'checkout -b to a new branch, set to HEAD' ' do_checkout branch2 ' -test_expect_failure 'checkout -b to a merge base' ' +test_expect_success 'checkout -b to a merge base' ' test_when_finished test_might_fail git branch -D branch2 && test_when_finished git checkout branch1 && git checkout -b branch2 branch1... @@ -128,7 +128,7 @@ test_expect_success 'checkout -B to an existing branch resets branch to HEAD' ' do_checkout branch2 "" -B ' -test_expect_failure 'checkout -B to a merge base' ' +test_expect_success 'checkout -B to a merge base' ' git checkout branch1 && git branch -D branch2 &&