From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Dmitry V. Levin" Subject: [PATCH 2/2] checkout: add a test for creating a new branch with regexp as a starting point Date: Sat, 31 Jul 2010 04:19:20 +0400 Message-ID: <20100731001919.GB24129@wo.int.altlinux.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Sat Jul 31 02:19:32 2010 Return-path: Envelope-to: gcvg-git-2@lo.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OeznU-0006U0-Ao for gcvg-git-2@lo.gmane.org; Sat, 31 Jul 2010 02:19:28 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753869Ab0GaATX (ORCPT ); Fri, 30 Jul 2010 20:19:23 -0400 Received: from vint.altlinux.org ([194.107.17.35]:44399 "EHLO vint.altlinux.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753791Ab0GaATW (ORCPT ); Fri, 30 Jul 2010 20:19:22 -0400 Received: from wo.int.altlinux.org (wo.int.altlinux.org [192.168.1.4]) by vint.altlinux.org (Postfix) with ESMTP id 4B1103F80005 for ; Sat, 31 Jul 2010 00:19:20 +0000 (UTC) Received: by wo.int.altlinux.org (Postfix, from userid 508) id 30FC63F48760; Sat, 31 Jul 2010 04:19:20 +0400 (MSD) Content-Disposition: inline In-Reply-To: Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: Reported-by: Ivan Zakharyaschev Signed-off-by: Dmitry V. Levin --- t/t2018-checkout-branch.sh | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/t/t2018-checkout-branch.sh b/t/t2018-checkout-branch.sh index 1caffea..4d26b2a 100755 --- a/t/t2018-checkout-branch.sh +++ b/t/t2018-checkout-branch.sh @@ -118,7 +118,20 @@ test_expect_success 'checkout -b to an existing branch fails' ' test_must_fail do_checkout branch2 $HEAD2 ' +test_expect_failure 'checkout -b new_branch :/regexp' ' + # clean up from previous test + git reset --hard && + + do_checkout old_regexp_branch branch1 && + test_commit first '' '' '' && + test_commit second '' '' '' && + + do_checkout new_regexp_branch :/first +' + test_expect_success 'checkout -B to an existing branch resets branch to HEAD' ' + # clean up from previous test + git reset --hard && git checkout branch1 && do_checkout branch2 "" -B -- ldv