From patchwork Mon Apr 20 08:54:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11498457 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EB9E01575 for ; Mon, 20 Apr 2020 08:55:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D450F21473 for ; Mon, 20 Apr 2020 08:55:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NdheBUiG" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726089AbgDTIy6 (ORCPT ); Mon, 20 Apr 2020 04:54:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725865AbgDTIy5 (ORCPT ); Mon, 20 Apr 2020 04:54:57 -0400 Received: from mail-qv1-xf43.google.com (mail-qv1-xf43.google.com [IPv6:2607:f8b0:4864:20::f43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47173C061A0C for ; Mon, 20 Apr 2020 01:54:56 -0700 (PDT) Received: by mail-qv1-xf43.google.com with SMTP id h6so756179qvz.8 for ; Mon, 20 Apr 2020 01:54:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=wfxmUCNHsYwhfP0jz3kebhckh4R4wMQOqHpWFT7Iuic=; b=NdheBUiG+KiXnUjCGrjuiWfB0xDVf01lqHVAeA2IVtYcZ5x0mo+Xv1F+KUIJH2vRZ8 k8iRFXhDNfj5dsAQsfjD/AQy4c8IqGP/iPTvCYAoRORAHL/2WDTA3pkWqbPX/1d2Q1Nj yC14fHeI6MBqE0xsX/UaDq8c0TSBbgXj6Z9iCEtCKGaTaNnW7bEdFxfIl3H8HBp/aDVM rYNRnxUliqrwDu8zhR2fQ2Pves3QwFuIBlheB0e2H91X3aM/Cf1I0uk84j/Z8aBFLugq sAhbXIDzNpgVOs7jagQnheLg1esD82H1Qj/ll0t8j3WsU1BTUBU5ZF1iXInURxSgkNls 0zrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wfxmUCNHsYwhfP0jz3kebhckh4R4wMQOqHpWFT7Iuic=; b=kNTHjvhMzmIYy5p7qNTXWZRC3rqB6XSV2jR38W7HL7H97uWhnQrtAm1Oi1vEPk5y99 YgiAaJ+Z+O0XRXqV45aSjJEz/rATqzJMlPj9530YpEAEIzmiXplfCnb+9B7Vrf1M60tN JAuoXsSbKeLTqEHt2OhsTl9IdEweSIhVvro3TTgS/onj1ZNteWAuE8r+2gJa/onvAn8B SPusOpCwYtjaEbnRSr2dftG5wLFbFKoCKlb54vECGKQzdvRbF/1T8i4r/0wlGat4GgYY DQjn1g9zjVLit8lA2ghLAd/iDCP2zAV8SEF4KAodDtpWHuwxRbSqU+DKOpUscIKJBZ5/ 8lTA== X-Gm-Message-State: AGi0PuZaDjnoWqkS5EWXSrG4zICtZFcmgHO8ccxo7/pw4xghhry5yK45 KLvOzFFO51V89VAO+30ebTPiJkVI X-Google-Smtp-Source: APiQypK4dXjpFoPiXaX47iqQO2jl6QJfh/vUIZSqSo7FvTLwE3+LyNwt2PBq6a2B2E4QKMIqlIcb2A== X-Received: by 2002:a05:6214:17ca:: with SMTP id cu10mr8566457qvb.166.1587372894977; Mon, 20 Apr 2020 01:54:54 -0700 (PDT) Received: from archbookpro.lan ([199.249.110.29]) by smtp.gmail.com with ESMTPSA id p25sm203222qkk.18.2020.04.20.01.54.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2020 01:54:54 -0700 (PDT) From: Denton Liu To: Git Mailing List Subject: [PATCH 1/8] t6030: use test_path_is_missing() Date: Mon, 20 Apr 2020 04:54:39 -0400 Message-Id: X-Mailer: git-send-email 2.26.0.159.g23e2136ad0 In-Reply-To: References: MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org The test_must_fail() function should only be used for git commands since we should assume that external commands work sanely. Replace `test_must_fail test -e` with `test_path_is_missing`. Signed-off-by: Denton Liu --- t/t6030-bisect-porcelain.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh index 821a0c88cf..1313142564 100755 --- a/t/t6030-bisect-porcelain.sh +++ b/t/t6030-bisect-porcelain.sh @@ -148,7 +148,7 @@ test_expect_success 'bisect start: no ".git/BISECT_START" created if junk rev' ' test_must_fail git bisect start $HASH4 foo -- && git branch > branch.output && grep "* other" branch.output > /dev/null && - test_must_fail test -e .git/BISECT_START + test_path_is_missing .git/BISECT_START ' test_expect_success 'bisect start: existing ".git/BISECT_START" not modified if junk rev' ' @@ -166,7 +166,7 @@ test_expect_success 'bisect start: no ".git/BISECT_START" if mistaken rev' ' test_must_fail git bisect start $HASH1 $HASH4 -- && git branch > branch.output && grep "* other" branch.output > /dev/null && - test_must_fail test -e .git/BISECT_START + test_path_is_missing .git/BISECT_START ' test_expect_success 'bisect start: no ".git/BISECT_START" if checkout error' ' @@ -175,7 +175,7 @@ test_expect_success 'bisect start: no ".git/BISECT_START" if checkout error' ' git branch && git branch > branch.output && grep "* other" branch.output > /dev/null && - test_must_fail test -e .git/BISECT_START && + test_path_is_missing .git/BISECT_START && test -z "$(git for-each-ref "refs/bisect/*")" && git checkout HEAD hello ' @@ -485,7 +485,7 @@ test_expect_success 'optimized merge base checks' ' git bisect bad && git bisect good "$A_HASH" > my_bisect_log4.txt && test_i18ngrep "merge base must be tested" my_bisect_log4.txt && - test_must_fail test -f ".git/BISECT_ANCESTORS_OK" + test_path_is_missing ".git/BISECT_ANCESTORS_OK" ' # This creates another side branch called "parallel" with some files From patchwork Mon Apr 20 08:54:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11498453 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 58BA081 for ; Mon, 20 Apr 2020 08:54:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3DC7821473 for ; Mon, 20 Apr 2020 08:54:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="m3ZzmHeH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726048AbgDTIy5 (ORCPT ); Mon, 20 Apr 2020 04:54:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725865AbgDTIy5 (ORCPT ); Mon, 20 Apr 2020 04:54:57 -0400 Received: from mail-qk1-x744.google.com (mail-qk1-x744.google.com [IPv6:2607:f8b0:4864:20::744]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0513C061A0F for ; Mon, 20 Apr 2020 01:54:56 -0700 (PDT) Received: by mail-qk1-x744.google.com with SMTP id 20so9679937qkl.10 for ; Mon, 20 Apr 2020 01:54:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=WNh2PdciZXeQAOKmhSRSdtAuo/MaAm16h7z3OTs+NHs=; b=m3ZzmHeHpM65O6GyEppAMIHDCl45EcZObEHv0RnSiF93wBw3UNAEoELFxbTNtOkrkQ MwdTCS1St5R/fB9lB9mBdrvvcxGcjjraMdxEhH64aCu8PdfUNp5dTGwtjmpvUIPCAovk VApJjXw8ZhabsStrADiDo/cnSSImbD3i8D4qaWSgr80NCcRxP60qVICwUR5gwzouV/DO mxs3F8C8yA5aj8hvA/3JY+vV3K15nrl9tt1MZvfQcZ3h81R6u83MgwDJeDBe2qsJVHlB Ygft5y0vj07OudFN69eccYKrQDFS/sW29XWkSxa+/+QtL+8cjQMgBlCwVsdfM96kVv2C Alag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WNh2PdciZXeQAOKmhSRSdtAuo/MaAm16h7z3OTs+NHs=; b=fp2FIfzwaTDEDGu6LEx0OnbwX8v3M+mc1YKl1/abqgjbS4ZG3tZPl95nf8J/CnxizM ztvbc3FmGHg71Rtll/9fB/0BiWuQbbzUZqaCCMaMl0x0gzQZtcyRgqN84L+SOgJJrENP JPwVGuS/FlHiS40UHDuNiEJRsKw5IwwTJEsiqHc7LPHy7+Sf0wN9YB6cP8yxt0Eed6B0 A1V2h2SsNXT+W4jxlGXTLEdipZQdTOKIQIy9vpvLsdVtGkTxKo99H9GnWCK8q4ODwktj IPY38uOAezAAz7hkpVaAP1NueMUc5FS+/MPM2bzJKjpUnv7sLHi7CaOQAIDWvugas9ej 1LDg== X-Gm-Message-State: AGi0PubiOKtjIutsKJGhtT4cBfAVjpO3FnuJC7mvbzn6Kjlz6P+p0wEn 3REGgd5WK7dvnZKrVUzPGhw9e6Wm X-Google-Smtp-Source: APiQypLmGmD34LpkL4yWFllb5+RiGLzH9MexmplKcsOI6YXymucblVBUG3SZxTZg4M5j5rJn7aPz3g== X-Received: by 2002:a37:98d:: with SMTP id 135mr14602501qkj.377.1587372895825; Mon, 20 Apr 2020 01:54:55 -0700 (PDT) Received: from archbookpro.lan ([199.249.110.29]) by smtp.gmail.com with ESMTPSA id p25sm203222qkk.18.2020.04.20.01.54.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2020 01:54:55 -0700 (PDT) From: Denton Liu To: Git Mailing List Subject: [PATCH 2/8] t7408: replace incorrect uses of test_must_fail Date: Mon, 20 Apr 2020 04:54:40 -0400 Message-Id: <17db727121925cf0774e95a80ea13bbea8264931.1587372771.git.liu.denton@gmail.com> X-Mailer: git-send-email 2.26.0.159.g23e2136ad0 In-Reply-To: References: MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org According to t/README, test_must_fail() should only be used to test for failure in Git commands. Replace the invocation of `test_must_fail test_path_is_file` with `test_path_is_missing` since, in this test case, the path should not exist at all. In all the cases where `test_must_fail test_alternate_is_used` appears, test_alternate_is_used() fails because test_line_count() cannot open the non-existent $alternates_file. Replace `test_must_fail test_alternate_is_used` with `test_path_is_missing` to test for this directly. Signed-off-by: Denton Liu --- t/t7408-submodule-reference.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/t/t7408-submodule-reference.sh b/t/t7408-submodule-reference.sh index 34ac28c056..a3892f494b 100755 --- a/t/t7408-submodule-reference.sh +++ b/t/t7408-submodule-reference.sh @@ -122,8 +122,8 @@ test_expect_success 'missing submodule alternate fails clone and submodule updat # update of the submodule succeeds test_must_fail git submodule update --init && # and we have no alternates: - test_must_fail test_alternate_is_used .git/modules/sub/objects/info/alternates sub && - test_must_fail test_path_is_file sub/file1 + test_path_is_missing .git/modules/sub/objects/info/alternates && + test_path_is_missing sub/file1 ) ' @@ -137,7 +137,7 @@ test_expect_success 'ignoring missing submodule alternates passes clone and subm # update of the submodule succeeds git submodule update --init && # and we have no alternates: - test_must_fail test_alternate_is_used .git/modules/sub/objects/info/alternates sub && + test_path_is_missing .git/modules/sub/objects/info/alternates && test_path_is_file sub/file1 ) ' @@ -182,7 +182,7 @@ check_that_two_of_three_alternates_are_used() { # immediate submodule has alternate: test_alternate_is_used .git/modules/subwithsub/objects/info/alternates subwithsub && # but nested submodule has no alternate: - test_must_fail test_alternate_is_used .git/modules/subwithsub/modules/sub/objects/info/alternates subwithsub/sub + test_path_is_missing .git/modules/subwithsub/modules/sub/objects/info/alternates } From patchwork Mon Apr 20 08:54:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11498455 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 992681575 for ; Mon, 20 Apr 2020 08:54:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8002B21473 for ; Mon, 20 Apr 2020 08:54:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="M2zxX5fD" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726105AbgDTIy6 (ORCPT ); Mon, 20 Apr 2020 04:54:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726067AbgDTIy5 (ORCPT ); Mon, 20 Apr 2020 04:54:57 -0400 Received: from mail-qv1-xf2e.google.com (mail-qv1-xf2e.google.com [IPv6:2607:f8b0:4864:20::f2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78078C061A0F for ; Mon, 20 Apr 2020 01:54:57 -0700 (PDT) Received: by mail-qv1-xf2e.google.com with SMTP id q2so1300819qvd.1 for ; Mon, 20 Apr 2020 01:54:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=NatCiaTlvegILyTVVpufX4IvCZVvj9x3yF5270PzODI=; b=M2zxX5fD4WuG8h8nb66ZYCStP77js/Drrrl5Qmldp9AT0xsj0bTfO3oOqJ9HaCKFlT Mt3XfDHfaq8Pt31XhjcZptswPokSGUUeEayCgt555NajgSmR++Hzyz01ZVTHIKh8vla6 pZabFtzvzqEdUi2HeLRloWBy+nzQTKu6D9UWjBXymuqO6uq4duY0OvhPl2rGEpyBgITT C2jJ6GQwoBWB5ejpmWpfD5qeQRdYB5CyIhoML5S256OhAvVdkbsEDfP5cCPKM+vlqBOy gXCid3Cr4MRGJXPqrwbw6p9HfcPdDhX/pPbiI9TFIN8rTFtoDz10CKeSkf4xg4gatLbB tgcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NatCiaTlvegILyTVVpufX4IvCZVvj9x3yF5270PzODI=; b=aNjplcbLO9F8cRHmM+trl9O8RuDSyZK3azzRIOqDL6P8OFVEDNViF8eV1u0Kn03Cgy RyijvP10MfNLIiVutdmPasJM3dxKTVMUS2+DTIMluMrG8CCCPkXUVdQ5jz2xXlOCQlS6 d3NDCLRf6BSvhg3ZfzDjVh0L5oQvrG6MvAyyOCeGlwE8AZj7cGA6ujf/AcvXbQAs6AGL Ho3t6NL7H13K4gmVhj1gVxIm7TruPyvRBS/5eazVNEweErB5TuwfD5tk2aOOvyYA9+UI RELl5BXcpHktGzLUjNg3D/z2MLyhrlRY4t3Cz6BeGOV6ajWuO07T15dQvsoTrwsBLZmp 1G9w== X-Gm-Message-State: AGi0PuZ9XTr2Ur4tDe0QuW48iAO2XUj+RvwiWQQxNjSQrxlU9HIoTAsd gfutkDvuC/jnkaZ3xcIOX2Il4N0K X-Google-Smtp-Source: APiQypIoMF8fBpZnjbum9RM0gQ9jJD+TMu0qmBCF3vVDqEo8ogi3GZmi9vf+/5vchhPMc9mVbdOYNw== X-Received: by 2002:a05:6214:1812:: with SMTP id o18mr14207076qvw.64.1587372896541; Mon, 20 Apr 2020 01:54:56 -0700 (PDT) Received: from archbookpro.lan ([199.249.110.29]) by smtp.gmail.com with ESMTPSA id p25sm203222qkk.18.2020.04.20.01.54.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2020 01:54:56 -0700 (PDT) From: Denton Liu To: Git Mailing List Subject: [PATCH 3/8] t7508: don't use `test_must_fail test_cmp` Date: Mon, 20 Apr 2020 04:54:41 -0400 Message-Id: X-Mailer: git-send-email 2.26.0.159.g23e2136ad0 In-Reply-To: References: MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org The test_must_fail function should only be used for git commands since we assume that external commands work sanely. Since test_cmp() just wraps an external command, replace `test_must_fail test_cmp` with `! test_cmp`. Signed-off-by: Denton Liu --- t/t7508-status.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t7508-status.sh b/t/t7508-status.sh index 482ce3510e..8e969f3e36 100755 --- a/t/t7508-status.sh +++ b/t/t7508-status.sh @@ -1471,7 +1471,7 @@ test_expect_success '"status.branch=true" same as "-b"' ' test_expect_success '"status.branch=true" different from "--no-branch"' ' git status -s --no-branch >expected_nobranch && git -c status.branch=true status -s >actual && - test_must_fail test_cmp expected_nobranch actual + ! test_cmp expected_nobranch actual ' test_expect_success '"status.branch=true" weaker than "--no-branch"' ' From patchwork Mon Apr 20 08:54:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11498459 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0F61781 for ; Mon, 20 Apr 2020 08:55:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ED1FD21473 for ; Mon, 20 Apr 2020 08:55:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZeG0S4rm" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726164AbgDTIzA (ORCPT ); Mon, 20 Apr 2020 04:55:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726091AbgDTIy6 (ORCPT ); Mon, 20 Apr 2020 04:54:58 -0400 Received: from mail-qk1-x732.google.com (mail-qk1-x732.google.com [IPv6:2607:f8b0:4864:20::732]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C063C061A0C for ; Mon, 20 Apr 2020 01:54:58 -0700 (PDT) Received: by mail-qk1-x732.google.com with SMTP id 20so9679987qkl.10 for ; Mon, 20 Apr 2020 01:54:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=eoA79kLMgYsAzWpBCLtFmrwK5icL4lqTYhIcgy6IYaU=; b=ZeG0S4rmGYgHeYopqfq+qEe71vN+pEmfKPmOc+HdUJbbye331PwrX0uaRPTtOH6C6P QuQA7luliTI9fiiU4iOOXxjU08/8MsIU2n7LE9WiRYo38eHysiCkOWWY+ZX6SzOHyOkZ POPhVA1mCkvLW4qHAaifSbKHj6EOvnrhtd2acEO2I9o7fq5znGR549ZJpWmCql9h9hEL KTZ35k8G9O3AacDoOJyLsaIAQcJ+3WXxfQOBMlYmlwZ4bq8QCJFfN8g0rqgi9U409WaG 4K+aaOTYgsl/m3PfHfsm2DCfMFU4eQFAVpNcWmMT8AfQ5byvKFlLpMnvYeNSUIWpklft WqrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=eoA79kLMgYsAzWpBCLtFmrwK5icL4lqTYhIcgy6IYaU=; b=ITq59jHfApXWAx6xBD90tEaCP3jSRG7GXgvo/yFFdqcQQ8vHwgyKi0GwjGBFom3SdK rVMJldWwE/bOD9ev18wu8h1Ws95D24VeUmp17GPghJuTWwca82K3HaZ9eplBVoOF/yCd bLYnKXbCYtLYi4zy1HF2BTqGItZxm+iBjHtyrqDxfchWDXrOBtuyo5pBiSHn0/wBnqJD af0r/6BpQSk6fiWwlHCZJYu3JSRdqWwsSexb+PUdSJktgUMm6l0q7s7YORbFIjLXyFq9 8KjylKL30V3UpHEWx0fM9FsLAt7H0guCGW2Hg8HIxDDwfRrXTypAKd/LBABahR9MqcGw Z9qQ== X-Gm-Message-State: AGi0PuZSQR8fkSnW0GVtPtkvsALPTVkNq36hl2erHWxnBVS0rv0VlErs GSSRK/zAV0QVu+hHxDjb1udjhZjN X-Google-Smtp-Source: APiQypIcwJ+TaePoFCymnlQGO4SyzCKYs8e+EmHBhIk6WSbJSO49FzpR+CCZ6iPmkx5Ld488TjckXA== X-Received: by 2002:a05:620a:13b9:: with SMTP id m25mr14763867qki.456.1587372897485; Mon, 20 Apr 2020 01:54:57 -0700 (PDT) Received: from archbookpro.lan ([199.249.110.29]) by smtp.gmail.com with ESMTPSA id p25sm203222qkk.18.2020.04.20.01.54.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2020 01:54:57 -0700 (PDT) From: Denton Liu To: Git Mailing List Subject: [PATCH 4/8] t9141: use test_path_is_missing() Date: Mon, 20 Apr 2020 04:54:42 -0400 Message-Id: <1eb50e1be2f548c65f5491a1554fc7d69fd261d4.1587372771.git.liu.denton@gmail.com> X-Mailer: git-send-email 2.26.0.159.g23e2136ad0 In-Reply-To: References: MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org The test_must_fail() function should only be used for git commands since we assume that external commands work sanely. Since, not only should these directories not exist, but there shouldn't exist _any_ filesystem entity in these paths, replace `test_must_fail test -d` with `test_path_is_missing`. Signed-off-by: Denton Liu --- t/t9141-git-svn-multiple-branches.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/t/t9141-git-svn-multiple-branches.sh b/t/t9141-git-svn-multiple-branches.sh index 8e7f7d68b7..bf168a3645 100755 --- a/t/t9141-git-svn-multiple-branches.sh +++ b/t/t9141-git-svn-multiple-branches.sh @@ -90,10 +90,10 @@ test_expect_success 'Multiple branch or tag paths require -d' ' ) && ( cd svn_project && svn_cmd up && - test_must_fail test -d b_one/Nope && - test_must_fail test -d b_two/Nope && - test_must_fail test -d tags_A/Tagless && - test_must_fail test -d tags_B/Tagless + test_path_is_missing b_one/Nope && + test_path_is_missing b_two/Nope && + test_path_is_missing tags_A/Tagless && + test_path_is_missing tags_B/Tagless ) ' From patchwork Mon Apr 20 08:54:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11498461 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E3ECA81 for ; Mon, 20 Apr 2020 08:55:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CBD8420A8B for ; Mon, 20 Apr 2020 08:55:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bKERZpjR" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726209AbgDTIzD (ORCPT ); Mon, 20 Apr 2020 04:55:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726067AbgDTIy7 (ORCPT ); Mon, 20 Apr 2020 04:54:59 -0400 Received: from mail-qv1-xf44.google.com (mail-qv1-xf44.google.com [IPv6:2607:f8b0:4864:20::f44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83E33C061A0C for ; Mon, 20 Apr 2020 01:54:59 -0700 (PDT) Received: by mail-qv1-xf44.google.com with SMTP id v18so4274266qvx.9 for ; Mon, 20 Apr 2020 01:54:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=BpRyGoJMzp7FknDxIkEzvsZj/dcMnzcFniZYoHX/CK0=; b=bKERZpjRSHGIgJoYQC8H8s+YNRsvjZNJYje7epcc5T/CIvbpM2lccewnCe9/Bq9fTH wm/OKgNkl53McMDjq7XQK2pH/wzguqvgt/89bSOfs4vxzDoRr/1BfqPtXvCD6DhP+WE4 yWWTESGk/c8VB9GuYRhTRAJnfGde+PDBNXKC6wLkt4ieBXQYltke2iK+Znda3uyaGfBU 1jV/WWbIqRVyfTUBweqTRshibUUsGVx6MbHD8qpBLLeve794ap7Gg8dK6pYGZNy1GqS9 lVvs/BfJ9y/Jv7RJkToJtn20zo+4x7PZQqcNi8Zue0+ILDsnNKfVv2GxuYP19lxfloqG Tx3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BpRyGoJMzp7FknDxIkEzvsZj/dcMnzcFniZYoHX/CK0=; b=VYk+QV1gT+Wy6WKWsI07QueQ2tEsIm1TEJHVJ0Jfkszx0Za9Q+bBdiSskQN6vSDE6V flcUBoEfysSNB/jKOudFUHPHT5GnKbvYRRMzFMF7yuMqwYX4nA8oeX4+NFWEeLUKRZVQ 4z9NbuswegTSwrf627oGGhBMrtBZX3fT6gekeZTHQscPTOTTLedPHDBGXzVqTCeDYhAJ 2Fb8WQJ2iyJlxQQmlMPE7jkmg4y9X6/JFJBuEdVQSzurJbLkJ5IlIJyswhLI3bdYC6/D HJOpEXfQBDyb2uWKePVmT5+p1q0Joj511s1Y8YV9KWpP15QwmxWWTD3QrQjnq5ebYF1i UD+g== X-Gm-Message-State: AGi0PubmJmOKvv/kZLumsOjqqLwEkeRV3ewF1LT+CMw6Av66aKBR7je6 Z1dYvz7a7QemJ5E1l6jAK9CJEP6c X-Google-Smtp-Source: APiQypL7hmPyxU8x4j+FFOYlyKBZFl8qfYvKNkluVl6wy/0XeyV15T6XsBuuhXemybnY1Geq0mnGdg== X-Received: by 2002:a0c:b5a2:: with SMTP id g34mr12489827qve.219.1587372898593; Mon, 20 Apr 2020 01:54:58 -0700 (PDT) Received: from archbookpro.lan ([199.249.110.29]) by smtp.gmail.com with ESMTPSA id p25sm203222qkk.18.2020.04.20.01.54.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2020 01:54:58 -0700 (PDT) From: Denton Liu To: Git Mailing List Subject: [PATCH 5/8] t9160: use test_path_is_missing() Date: Mon, 20 Apr 2020 04:54:43 -0400 Message-Id: <572d12a5fb4777b10417bb4fc7e38954796a8404.1587372771.git.liu.denton@gmail.com> X-Mailer: git-send-email 2.26.0.159.g23e2136ad0 In-Reply-To: References: MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org The test_must_fail() function should only be used for git commands since we assume that external commands work sanely. Since, not only should this file not exist, but there shouldn't exit _any_ filesystem entity in these paths, replace `test_must_fail test -f` with `test_path_is_missing`. Signed-off-by: Denton Liu --- t/t9160-git-svn-preserve-empty-dirs.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/t9160-git-svn-preserve-empty-dirs.sh b/t/t9160-git-svn-preserve-empty-dirs.sh index 0ede3cfedb..36c6b1a12f 100755 --- a/t/t9160-git-svn-preserve-empty-dirs.sh +++ b/t/t9160-git-svn-preserve-empty-dirs.sh @@ -86,8 +86,8 @@ test_expect_success 'remove non-last entry from directory' ' cd "$GIT_REPO" && git checkout HEAD~2 ) && - test_must_fail test -f "$GIT_REPO"/2/.gitignore && - test_must_fail test -f "$GIT_REPO"/3/.gitignore + test_path_is_missing "$GIT_REPO"/2/.gitignore && + test_path_is_missing "$GIT_REPO"/3/.gitignore ' # After re-cloning the repository with --placeholder-file specified, there From patchwork Mon Apr 20 08:54:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11498463 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7BDFB15AB for ; Mon, 20 Apr 2020 08:55:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 626862145D for ; Mon, 20 Apr 2020 08:55:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="tXJ0tkue" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726228AbgDTIzE (ORCPT ); Mon, 20 Apr 2020 04:55:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726173AbgDTIzB (ORCPT ); Mon, 20 Apr 2020 04:55:01 -0400 Received: from mail-qv1-xf42.google.com (mail-qv1-xf42.google.com [IPv6:2607:f8b0:4864:20::f42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8043AC061A0F for ; Mon, 20 Apr 2020 01:55:00 -0700 (PDT) Received: by mail-qv1-xf42.google.com with SMTP id y19so4291838qvv.4 for ; Mon, 20 Apr 2020 01:55:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=kTTGKq4yRISi6AVG7dlVR3pmmwghy+6w85Tlnfkpl4E=; b=tXJ0tkueN3iMamZ6Cbjv9dGCfR6wC6S6MGpu6ZlcITopXYHRwOZNDjOUBKetbbgDib yWL8/yMovGtA63eEbHnuOtMO8Hx9AkEqvcCOhwSozQCXDDU4EpP17ABvRBQbmAm2hnxz 2s6idMAi5jR43dR1FGtQK2n1hDoe2UI/xVG1ARYJk53g3/p/tKor6IxfRSelq2A/KZSy fy/lw/N5sY3nn0DRg1L65pIjY5ZsPwgfyCcMb0Cxsvg5hifGR6kzy169GhCduv/bGIm5 MEM+VHXrIG5kYVqkOG0sYL4daWnnI4MPXG4KMiPiMtX1RAxs1os7sBxzggsSOC70YigV h9lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kTTGKq4yRISi6AVG7dlVR3pmmwghy+6w85Tlnfkpl4E=; b=kfkuzlW6AGqJs62sdTk5ja1cKWBXHCfxBUnN1XATycrQO+v1n0nFKP2ih8pof80s+o 7IyRHqlJWFEP8dK5huSxJTr+HHlJB3zZTSx+KCoR5e9BHTgC4DT0DackbvMEUb4VtXYF FtDklmIH8aIHNTmdtwiSrpouB0T6/R9w7WGl9cplIGhhVpAnyZj7vdiRCKfYSGwPFE1U nuXtMe7bpEKmKsUvqquvJL4VV8M2ZP//1Dl/GkLpmX2a1IOFxpyenMwONXe+D9dbiFTi Kn93oYAH+Em4nHm/AbWGmHU3YIk3SV0KgZCkWH9eXlRE9YUZvjpdgEvr4PKZkUL7M2hg Cxrg== X-Gm-Message-State: AGi0PuYpAvAlsGMLZOAJ5IVOuxAQ/4zHDkmITVBCLZDXTa5TmKFa0xAi vKNEfMJU/9uDKuIOVsOO2b8yjWHc X-Google-Smtp-Source: APiQypKADH59WIFv/0EYjeXF9JSHcR74TqXSz6B+LSxCcetW7wqu/Q9bscylmx5jPXdcf8q+R5pVvQ== X-Received: by 2002:a0c:e844:: with SMTP id l4mr13596926qvo.247.1587372899612; Mon, 20 Apr 2020 01:54:59 -0700 (PDT) Received: from archbookpro.lan ([199.249.110.29]) by smtp.gmail.com with ESMTPSA id p25sm203222qkk.18.2020.04.20.01.54.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2020 01:54:59 -0700 (PDT) From: Denton Liu To: Git Mailing List Subject: [PATCH 6/8] t9164: don't use `test_must_fail test_cmp` Date: Mon, 20 Apr 2020 04:54:44 -0400 Message-Id: X-Mailer: git-send-email 2.26.0.159.g23e2136ad0 In-Reply-To: References: MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org The test_must_fail function should only be used for git commands since we assume that external commands work sanely. Since test_cmp() just wraps an external command, replace `test_must_fail test_cmp` with `! test_cmp`. Signed-off-by: Denton Liu --- t/t9164-git-svn-dcommit-concurrent.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/t9164-git-svn-dcommit-concurrent.sh b/t/t9164-git-svn-dcommit-concurrent.sh index 90346ff4e9..8466269bf5 100755 --- a/t/t9164-git-svn-dcommit-concurrent.sh +++ b/t/t9164-git-svn-dcommit-concurrent.sh @@ -92,7 +92,7 @@ test_expect_success 'check if post-commit hook creates a concurrent commit' ' echo 1 >> file && svn_cmd commit -m "changing file" && svn_cmd up && - test_must_fail test_cmp auto_updated_file au_file_saved + ! test_cmp auto_updated_file au_file_saved ) ' @@ -103,7 +103,7 @@ test_expect_success 'check if pre-commit hook fails' ' echo 2 >> file && svn_cmd commit -m "changing file once again" && echo 3 >> file && - test_must_fail svn_cmd commit -m "this commit should fail" && + ! svn_cmd commit -m "this commit should fail" && svn_cmd revert file ) ' From patchwork Mon Apr 20 08:54:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11498467 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8050781 for ; Mon, 20 Apr 2020 08:55:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 67980214AF for ; Mon, 20 Apr 2020 08:55:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="R3vK95Xk" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726319AbgDTIzH (ORCPT ); Mon, 20 Apr 2020 04:55:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726208AbgDTIzD (ORCPT ); Mon, 20 Apr 2020 04:55:03 -0400 Received: from mail-qk1-x744.google.com (mail-qk1-x744.google.com [IPv6:2607:f8b0:4864:20::744]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71099C061A10 for ; Mon, 20 Apr 2020 01:55:01 -0700 (PDT) Received: by mail-qk1-x744.google.com with SMTP id n143so2937825qkn.8 for ; Mon, 20 Apr 2020 01:55:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=lA3rZUgviNB3jkCSJaUQlgYG1gAy+MDb20J3+/yYBDo=; b=R3vK95XkktOuksdyw64/YK10aCHEQh3xZmIciXiY1tbnOicNas+IFF7PL5DFcKiFfS R1MExldhFWTXdnaxWdVCkTtLo5cFrRNBJ67VYho6n6gpf1epbAqE2Jo49LtN9R96uoP0 XhZa+e6oYTdqI11XnLJzSqL0evKYVIbvng5UdLsiN3IifUbwUe4QmmUe2fkETOZ5BGye rXKWkTk7vBPEZRehCwbQODWsVMHgpTDPObdpZmY03lt7KhR5/7TMAzBZSbJXmwDxt2mS 0QSWvcumdVjL4KeFxOkZWIK0Y1ySh5RF6ZDTJBbty+dSgG2t15a/pIb8dKphGT9CVRUy CEZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lA3rZUgviNB3jkCSJaUQlgYG1gAy+MDb20J3+/yYBDo=; b=Afr62KDOurXIrqg+93uuvR9Jjy/KBHzedHQOmqd6Ah3rFEzZUs602icwOBdlwlqmuD 77ekE4KMStC4vyqV7mFadjvfMZ3hfq0j4rt3HbQOv5Br9vFAOcg+iO/UMAwtE7K9P3lY FJAfT24viZBSy8y7/UQd8a76zugSlw0YE1tXlnYV/0qfjUjqdZR15Y5LTVu4nml2oizn 1/CFsJKWYhdTV8sML08TouxjBS/yoykgAasW8nxv4WmxdjIZmtcQHPdIHw92djKoOCBn n2a8d26sXDUWzLRC6PzpU2+edff/LI5ggefe8/A/KpszG1YgZmsTFnInh12zIPcri7yl qqEg== X-Gm-Message-State: AGi0PuaGWMvuSituneZcfRhdz941v7mSFQAs9oTh4z273s9fXAoEiIJm P2d2sTkzxHtXLyD2+7pqEAgVkCbn X-Google-Smtp-Source: APiQypLdH/5GkIgByBxjOVmDcnTVG67/bcFBv/5c9H5YPdeJ0pDjI5kbKOMJ1LNLsyJQAThX/1jOFw== X-Received: by 2002:a37:690:: with SMTP id 138mr15400691qkg.414.1587372900531; Mon, 20 Apr 2020 01:55:00 -0700 (PDT) Received: from archbookpro.lan ([199.249.110.29]) by smtp.gmail.com with ESMTPSA id p25sm203222qkk.18.2020.04.20.01.54.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2020 01:55:00 -0700 (PDT) From: Denton Liu To: Git Mailing List Subject: [PATCH 7/8] t9819: don't use test_must_fail with p4 Date: Mon, 20 Apr 2020 04:54:45 -0400 Message-Id: X-Mailer: git-send-email 2.26.0.159.g23e2136ad0 In-Reply-To: References: MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org We were using `test_must_fail p4` to test that the p4 command failed as expected. However, test_must_fail() is used to ensure that commands fail in an expected way, not due to something like a segv. Since we are not in the business of verifying the sanity of the external world, replace `test_must_fail p4` with `! p4` and assume that the `p4` command does not die unexpectedly. Signed-off-by: Denton Liu --- t/t9819-git-p4-case-folding.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t9819-git-p4-case-folding.sh b/t/t9819-git-p4-case-folding.sh index 600ce1e0b0..b4d93f0c17 100755 --- a/t/t9819-git-p4-case-folding.sh +++ b/t/t9819-git-p4-case-folding.sh @@ -30,7 +30,7 @@ test_expect_success 'Check p4 is in case-folding mode' ' cd "$cli" && >lc/FILE.TXT && p4 add lc/FILE.TXT && - test_must_fail p4 submit -d "Cannot add file differing only in case" lc/FILE.TXT + ! p4 submit -d "Cannot add file differing only in case" lc/FILE.TXT ) ' From patchwork Mon Apr 20 08:54:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11498465 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E8E9F1575 for ; Mon, 20 Apr 2020 08:55:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D092721927 for ; Mon, 20 Apr 2020 08:55:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="vHUJgNLs" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726371AbgDTIzH (ORCPT ); Mon, 20 Apr 2020 04:55:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726201AbgDTIzC (ORCPT ); Mon, 20 Apr 2020 04:55:02 -0400 Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67949C061A41 for ; Mon, 20 Apr 2020 01:55:02 -0700 (PDT) Received: by mail-qt1-x841.google.com with SMTP id o10so7807716qtr.6 for ; Mon, 20 Apr 2020 01:55:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=JWl+maHKiHdh8fIgeXEeOMTDn85biUP5PyhN2YtyhGo=; b=vHUJgNLsI5vDBFcjH1128pI2mcbfby4Kiq7JHLJcDUj4BSFJa2w1kdQCXn9IoSc1jL xqY55OQSzGX+sR4GDe7gmLkKVVCPBCe+MBCvb9xUqxE+zSMRhy3/8Kx1GtSSWPZXpYre Gb95PXv7U66fETGbdFjAEKTBl45dWMX/7Qtu9x8W9PPC6e1f0fBqpuqQuxJjTbpu+gub rMjG53KZXgj5cQkBIZGll4yjkdO7O8G39ue58Qb994dk2PbAZILaxVbDg7fulVTXRSYc XFSuDYxwX0T9MYDhfJjjBX33p//O7b611Sex2DES9zJgyndSCPyFouKj6l7Qj5oOzREW XzZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JWl+maHKiHdh8fIgeXEeOMTDn85biUP5PyhN2YtyhGo=; b=Szqk89Ai4bJNIqpoKRmH5z505FKqP1gr6i9SA+/r2FnMRZ1nz9sStjl/bC5aYHzWf5 YDpOkXlhWHy7q3LFVrCGlGOqUDbvtVyBBI21RTaLdEulJ8UsioLugtFlP0iOnOatTrYz +UXd90WZ9blrqiXXcfDhugLotZlvpkxRKzf3UDzdZKJjAEISyBnRjlvqssQYzxemLYX+ SwkmdOyOsg29YKTHDM/0arPZqnE1JfhvaTsCUpoa0CVzmgiDuoiv91/HrcCBj3XkhAoV HwP2uB9cCrofpqxIjNwJMVFxdkpZ4YKPX6F/w8iEItxrGEo1VnKC5qn0/m09zMzISwZE g6Zg== X-Gm-Message-State: AGi0PuZT2QLoU/F/sFa3jws+NDcCaw3SbDdfbzGyF37316Eb5QwacHWc 3257y+eCvrqvxV64dv/TkUK6SlrG X-Google-Smtp-Source: APiQypJH+dywFbb7/j0F89MOCGbCd/ZskfvzAmK8jUC05wVNeqeQN9rxUTUs+Bh3FnjUe5cqT98Cow== X-Received: by 2002:ac8:568b:: with SMTP id h11mr15322170qta.197.1587372901460; Mon, 20 Apr 2020 01:55:01 -0700 (PDT) Received: from archbookpro.lan ([199.249.110.29]) by smtp.gmail.com with ESMTPSA id p25sm203222qkk.18.2020.04.20.01.55.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2020 01:55:01 -0700 (PDT) From: Denton Liu To: Git Mailing List Subject: [PATCH 8/8] t9902: don't use `test_must_fail __git_*` Date: Mon, 20 Apr 2020 04:54:46 -0400 Message-Id: <6cfa2c447e1196d6c4325aff9fac52434d10fda8.1587372771.git.liu.denton@gmail.com> X-Mailer: git-send-email 2.26.0.159.g23e2136ad0 In-Reply-To: References: MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org We should only use test_must_fail() to test git commands. Replace `test_must_fail` with `!` so that we don't use test_must_fail() on the completion functions. This is done because test_must_fail() is used to except git exiting with an expected error but it will still return an error if it detects unexpected errors such as a segfault. In the case of these completion functions, the return codes of the git commands aren't checked and, most of the time, they will just explicitly return 1 or have an unrelated command return 0. As a result, it doesn't really make sense to use `test_must_fail` so use `!` instead. Signed-off-by: Denton Liu --- t/t9902-completion.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh index 5505e5aa24..320c755971 100755 --- a/t/t9902-completion.sh +++ b/t/t9902-completion.sh @@ -294,7 +294,7 @@ test_expect_success '__git_find_repo_path - "git -C" while .git directory in par test_expect_success '__git_find_repo_path - non-existing path in "git -C"' ' ( __git_C_args=(-C non-existing) && - test_must_fail __git_find_repo_path && + ! __git_find_repo_path && printf "$__git_repo_path" >"$actual" ) && test_must_be_empty "$actual" @@ -303,7 +303,7 @@ test_expect_success '__git_find_repo_path - non-existing path in "git -C"' ' test_expect_success '__git_find_repo_path - non-existing path in $__git_dir' ' ( __git_dir="non-existing" && - test_must_fail __git_find_repo_path && + ! __git_find_repo_path && printf "$__git_repo_path" >"$actual" ) && test_must_be_empty "$actual" @@ -313,7 +313,7 @@ test_expect_success '__git_find_repo_path - non-existing $GIT_DIR' ' ( GIT_DIR="$ROOT/non-existing" && export GIT_DIR && - test_must_fail __git_find_repo_path && + ! __git_find_repo_path && printf "$__git_repo_path" >"$actual" ) && test_must_be_empty "$actual" @@ -362,7 +362,7 @@ test_expect_success '__git_find_repo_path - not a git repository' ' cd non-repo && GIT_CEILING_DIRECTORIES="$ROOT" && export GIT_CEILING_DIRECTORIES && - test_must_fail __git_find_repo_path && + ! __git_find_repo_path && printf "$__git_repo_path" >"$actual" ) && test_must_be_empty "$actual" @@ -381,7 +381,7 @@ test_expect_success '__gitdir - finds repo' ' test_expect_success '__gitdir - returns error when cannot find repo' ' ( __git_dir="non-existing" && - test_must_fail __gitdir >"$actual" + ! __gitdir >"$actual" ) && test_must_be_empty "$actual" ' @@ -608,7 +608,7 @@ test_expect_success '__git_is_configured_remote' ' git remote add remote_2 git://remote_2 && ( verbose __git_is_configured_remote remote_2 && - test_must_fail __git_is_configured_remote non-existent + ! __git_is_configured_remote non-existent ) '