From patchwork Tue Dec 17 12:01:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11297421 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 13A806C1 for ; Tue, 17 Dec 2019 12:01:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E5F742146E for ; Tue, 17 Dec 2019 12:01:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="u6B2O+s8" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727329AbfLQMBp (ORCPT ); Tue, 17 Dec 2019 07:01:45 -0500 Received: from mail-pl1-f175.google.com ([209.85.214.175]:43004 "EHLO mail-pl1-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726141AbfLQMBp (ORCPT ); Tue, 17 Dec 2019 07:01:45 -0500 Received: by mail-pl1-f175.google.com with SMTP id p9so1765627plk.9 for ; Tue, 17 Dec 2019 04:01:44 -0800 (PST) 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=7ALs8fUkjKgVaZDZ9NjVwuPxUlFirl7OgFe2AWO2kaw=; b=u6B2O+s8MIZkO6L5eDC9Cl6lfwRNj8UkZJvB6z+oNVN7Hf34RrmubIxhdwBR+F9w1m TIBDSRlM1syOqj7cyheAbVR9DBYg6g5wlWOGaXWWzzikqD9uf6/rQ+a+NPkZLis1INyT JLRAoa+9RHfHKWATeuHN6wBaGxMFQgMijXgmdLUWCOsbrRcuMNvAxM5yeuQ24veAim88 xVNgcjlXV4QoAS5nGH6CpVzLKxXShhcHJf6HLgyhEduDFKgif2mEYMNeFnN6atd6iSH+ VBalPRRk42+l8ihN/sSBkjOhcIVdB6RKwqJz8oKsQ86n3aUIQJZPnCoLd/5+9ISU5wPM L75w== 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=7ALs8fUkjKgVaZDZ9NjVwuPxUlFirl7OgFe2AWO2kaw=; b=EdWxtnd+cLaaaqnfD+s3TK40glD+IxDSLKrRdjydP6tTXNzwFh0aAR+dyT5eWst6Qz jt0YeHrHlqr0OaAcrF/lct/PFZr4lPgJK3OujVS4AwCxVZ0YjQ+MwCaYCwWJAHlU/nrb uVGzvKCUBAs8XqcDGHk3JYaFF2G+7RgCUIQ3M3RCFJo7n2d5d2cOB5oESv46/NxbYQJq jM/zMdOdccrKNtN7tN2a1dLWbx5gcRg+35ieOR14ZpVhdByMNjhvRWgsygNBjc2WqBYj bKJTF9jNVB5aGHWJP7yNXsC50+WDLFx9Pvja64M1nAPYJ+C8lSkc0UrEGwduAi0KRfL4 xaQg== X-Gm-Message-State: APjAAAUTI6/kCE+F9VIVH7+KmPuEaZ6Ywaq0B96Bz6mPoSaOgMq10JGA kLdNy0xvwhGbEW/8kW0gxYAYEhoq X-Google-Smtp-Source: APXvYqzzIfnw2BUv8zAJVeNOwqUQ0NLpRLdsVtmCk2e9meUCBac6WfzDhs4oZJEB6wEA1WhOMDFSJQ== X-Received: by 2002:a17:90a:e2d4:: with SMTP id fr20mr5660541pjb.85.1576584103947; Tue, 17 Dec 2019 04:01:43 -0800 (PST) Received: from archbookpro.hsd1.ca.comcast.net ([2601:646:280:1b30:b0bc:639f:d5c8:2bcf]) by smtp.gmail.com with ESMTPSA id a15sm27531723pfh.169.2019.12.17.04.01.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Dec 2019 04:01:43 -0800 (PST) From: Denton Liu To: Git Mailing List Subject: [PATCH 01/15] test-lib-functions: introduce test_non_git_might_fail() Date: Tue, 17 Dec 2019 04:01:26 -0800 Message-Id: <85cee927656cebed34bc93280d0b2d89e0caa570.1576583819.git.liu.denton@gmail.com> X-Mailer: git-send-email 2.24.0.627.geba02921db 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 In a future commit, we will be preventing the use of the test_must_fail()-family of functions (including test_might_fail()) on non-git comands. To prep for this, introduce the test_non_git_might_fail() function which is used to replace non-git invocations of test_might_fail(). The test_non_git_might_fail() function is a lightweight replacement, always masking the return status of the command and returning a non-error exit code. Unlike test_might_fail(), it does not check for abnormal exit conditions such as a segv. This is because we are not in the business of checking the sanity of the external environment and we can assume that it works properly. Signed-off-by: Denton Liu --- t/test-lib-functions.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh index 284c52d076..61d27f1ec6 100644 --- a/t/test-lib-functions.sh +++ b/t/test-lib-functions.sh @@ -891,6 +891,15 @@ test_expect_code () { return 1 } 7>&2 2>&4 +# Similar to test_might_fail, but much simpler. This is intended for use +# with non-git commands that we can assume will work sanely so we don't +# need to check for conditions such as a segv. + +test_non_git_might_fail () { + "$@" 2>&7 + return 0 +} + # test_cmp is a helper function to compare actual and expected output. # You can use it like: # From patchwork Tue Dec 17 12:01:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11297449 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 6463E930 for ; Tue, 17 Dec 2019 12:02:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 411C3207FF for ; Tue, 17 Dec 2019 12:02:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="aBVA2IWh" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727427AbfLQMBq (ORCPT ); Tue, 17 Dec 2019 07:01:46 -0500 Received: from mail-pg1-f194.google.com ([209.85.215.194]:39147 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726943AbfLQMBp (ORCPT ); Tue, 17 Dec 2019 07:01:45 -0500 Received: by mail-pg1-f194.google.com with SMTP id b137so5564581pga.6 for ; Tue, 17 Dec 2019 04:01:45 -0800 (PST) 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=+ozZ1TvuyuN0T8hy81nZYO8hv7bNr46wsla2AG8SvEg=; b=aBVA2IWhHrkbAwaUlbgTohCd5+NujVrTbZSkioSmXSshFk2nY4dj6j1STfZdGTJQFn kYhEZu9ISxGFuaWSanbq7LjgxmTT0ulCI9/nLKmL75ZMrXHzkmEnU5IUtoprmdyDtd9e JzQ9ptNzvBAMdDVTSKPw3nkgP51sc/0QjgYIRQiXdX5g87spK5a+pycRxr0r9lmHwBDJ D88xli3G37kX29XdVoqMgK/HPfCbcirtVDWTHMY7gBKrRYfo4rskTLhsAIQJSz5w7JU+ MSwrqgFJXJZ/o7aMKTth0B0+2yJBfM4LnLc8mtvyiLD8/iRCoDxKHAcFQZsojeCM9LPl gtFw== 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=+ozZ1TvuyuN0T8hy81nZYO8hv7bNr46wsla2AG8SvEg=; b=EtBs/Re6WWm6bM+mD6pxugnQPE1/6eB8eybZWnnhUgYPt4fTKz8tX2vTdlowwaDknl TY/BJNlxs0NBuyGoQRS+mkj8ES3/NG3EFD9Ug36z7f34CXspDMwL7V9rt/5Bxi5N/wT6 SiHQ4x/ZEezs0DKvPB58NLTuGfaG1+A0wTeto7xqXE6q6nYzJDykm+KUXSYg9XOZD3Ic mkomH2yHftZQDHseX+QaaZFR531SvKuLGQKcdS5CgoMghndj2n3ITHW6xXkdin7RKA3X k9R5ei+Dv2b/RnYoIpuxfA5pssE7OHjZASemdYS0fHdCrjzTya/Gqd9ysdIr/PNUp9z3 b6rA== X-Gm-Message-State: APjAAAX+8nA0+/KIrBsVE2gS/2s6R7PbcRZP+L8dTVNICi7aliGpaqN+ enhMKT2J8bxbyIZO74x6sADCL4ap X-Google-Smtp-Source: APXvYqyTgWAbiXnS5RIiTxLcz/uDl/gKwoJ9Cp0EQ1taXheSzyq6SfPpfvWaIevAclR1sy6DjxJdvQ== X-Received: by 2002:aa7:90c4:: with SMTP id k4mr22179728pfk.216.1576584104844; Tue, 17 Dec 2019 04:01:44 -0800 (PST) Received: from archbookpro.hsd1.ca.comcast.net ([2601:646:280:1b30:b0bc:639f:d5c8:2bcf]) by smtp.gmail.com with ESMTPSA id a15sm27531723pfh.169.2019.12.17.04.01.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Dec 2019 04:01:44 -0800 (PST) From: Denton Liu To: Git Mailing List Subject: [PATCH 02/15] t/lib-git-p4: use test_path_is_missing() Date: Tue, 17 Dec 2019 04:01:27 -0800 Message-Id: <3d64837af1bc2af972ae1415502bbbde26ee3784.1576583819.git.liu.denton@gmail.com> X-Mailer: git-send-email 2.24.0.627.geba02921db 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 Previously, cleanup_git() would use `test_must_fail test -d` to ensure that the directory is removed. However, test_must_fail should only be used for git commands. Use test_path_is_missing() instead to check that the directory has been removed. Signed-off-by: Denton Liu --- t/lib-git-p4.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/lib-git-p4.sh b/t/lib-git-p4.sh index 547b9f88e1..5aff2abe8b 100644 --- a/t/lib-git-p4.sh +++ b/t/lib-git-p4.sh @@ -175,7 +175,7 @@ stop_and_cleanup_p4d () { cleanup_git () { retry_until_success rm -r "$git" - test_must_fail test -d "$git" && + test_path_is_missing "$git" && retry_until_success mkdir "$git" } From patchwork Tue Dec 17 12:01:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11297423 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 C383A930 for ; Tue, 17 Dec 2019 12:01:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A15362146E for ; Tue, 17 Dec 2019 12:01:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CUXnowP7" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727519AbfLQMBr (ORCPT ); Tue, 17 Dec 2019 07:01:47 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:33168 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726141AbfLQMBq (ORCPT ); Tue, 17 Dec 2019 07:01:46 -0500 Received: by mail-pl1-f194.google.com with SMTP id c13so6024638pls.0 for ; Tue, 17 Dec 2019 04:01:46 -0800 (PST) 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=KC3b1V5hIhFl9AM1MF2BrwPsPvr0CMh6y606Br4avh4=; b=CUXnowP7Nts4IR/5gO/Pit6tbji09FhljKBAIP3LAVMhCy63hzrkSvIwebX3b60VKd 1kfaol8RfzMIY00CCVpgWd9n1eErev27pW/W1dQHvStQxGJEczv1MwYsOdWhbTPUqarT 9UoKmTuOWBQruip2IJx1aVGP1NU969E+2H8ZKsHlFbwma2owva8zMEq3/jdYV/FAsRj3 fXbl5m7aSVm3UAok+zbWo9bAE3ak0sAwt18JGP1k7/FMtirYs7J5psz2EICFw7oaEsSF mQnbiPyYc7ZPs/Lyxj21o42S/GTBFz1yRpkScV5DxTOwQ8oQQkpTOTFh/P331km8PIMg D7Uw== 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=KC3b1V5hIhFl9AM1MF2BrwPsPvr0CMh6y606Br4avh4=; b=nEAiWEyEtOI+I85YGdwQ4B+6cOAwpm6TxIij7Sl9g7xR4N4sDAlsTFx2PR8z/9GdQD 2ZrscZ736qbZqrsFEojuugg8wp0mVaG2qhZoxSC2+cXwoWblCuaErgoQOWHknq+W+UNY wik+vE7vVMNI9RrUYyfF5HAyHJL2Jnw9zbbEozHw+eR8M7166DZd+UOSkUa3kr8nwBdE eWvBFBJVR6+GWw3V5udlNDP54LiV/LVDRZCFLyAHdFJkPOKvKtHET+AF/zL7NSQ55yg6 nBfumPI3elo8uCImVqh1bdhuasmTzJSRvX1aEgP7XnW1bYXiIfCP0Py5Zya5ztbfgWic O38A== X-Gm-Message-State: APjAAAV8L346iTy1qPeJ0mxQGWB3iJOrNY5IPzKjccOpNKWkiNtywxhv qH+UhSaPlfjpFX0TvwIW6Nf6CPCe X-Google-Smtp-Source: APXvYqwtR/Jz87bkuy1hnqwg52cM3vVoLuVMmfILpYm82fe8LXD8cgFXn5MkynI16H86Xlw+OX8O8Q== X-Received: by 2002:a17:90a:c790:: with SMTP id gn16mr5646662pjb.76.1576584105468; Tue, 17 Dec 2019 04:01:45 -0800 (PST) Received: from archbookpro.hsd1.ca.comcast.net ([2601:646:280:1b30:b0bc:639f:d5c8:2bcf]) by smtp.gmail.com with ESMTPSA id a15sm27531723pfh.169.2019.12.17.04.01.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Dec 2019 04:01:45 -0800 (PST) From: Denton Liu To: Git Mailing List Subject: [PATCH 03/15] t0000: replace test_must_fail with ! for run_sub_test_lib_test() Date: Tue, 17 Dec 2019 04:01:28 -0800 Message-Id: X-Mailer: git-send-email 2.24.0.627.geba02921db 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. We use test_must_fail to test run_sub_test_lib_test() but that function does not invoke any git commands internally. Replace these instances of `test_must_fail` with `!`. Signed-off-by: Denton Liu --- t/t0000-basic.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh index 8a81a249d0..d60ad4b78b 100755 --- a/t/t0000-basic.sh +++ b/t/t0000-basic.sh @@ -155,7 +155,7 @@ test_expect_success 'pretend we have a fully passing test suite' " " test_expect_success 'pretend we have a partially passing test suite' " - test_must_fail run_sub_test_lib_test \ + ! run_sub_test_lib_test \ partial-pass '2/3 tests passing' <<-\\EOF && test_expect_success 'passing test #1' 'true' test_expect_success 'failing test #2' 'false' @@ -219,7 +219,7 @@ test_expect_success 'pretend we have fixed one of two known breakages (run in su " test_expect_success 'pretend we have a pass, fail, and known breakage' " - test_must_fail run_sub_test_lib_test \ + ! run_sub_test_lib_test \ mixed-results1 'mixed results #1' <<-\\EOF && test_expect_success 'passing test' 'true' test_expect_success 'failing test' 'false' @@ -238,7 +238,7 @@ test_expect_success 'pretend we have a pass, fail, and known breakage' " " test_expect_success 'pretend we have a mix of all possible results' " - test_must_fail run_sub_test_lib_test \ + ! run_sub_test_lib_test \ mixed-results2 'mixed results #2' <<-\\EOF && test_expect_success 'passing test' 'true' test_expect_success 'passing test' 'true' @@ -274,7 +274,7 @@ test_expect_success 'pretend we have a mix of all possible results' " " test_expect_success C_LOCALE_OUTPUT 'test --verbose' ' - test_must_fail run_sub_test_lib_test \ + ! run_sub_test_lib_test \ t1234-verbose "test verbose" --verbose <<-\EOF && test_expect_success "passing test" true test_expect_success "test with output" "echo foo" @@ -301,7 +301,7 @@ test_expect_success C_LOCALE_OUTPUT 'test --verbose' ' ' test_expect_success 'test --verbose-only' ' - test_must_fail run_sub_test_lib_test \ + ! run_sub_test_lib_test \ t2345-verbose-only-2 "test verbose-only=2" \ --verbose-only=2 <<-\EOF && test_expect_success "passing test" true @@ -834,7 +834,7 @@ then fi test_expect_success 'tests clean up even on failures' " - test_must_fail run_sub_test_lib_test \ + ! run_sub_test_lib_test \ failing-cleanup 'Failing tests with cleanup commands' <<-\\EOF && test_expect_success 'tests clean up even after a failure' ' touch clean-after-failure && @@ -863,7 +863,7 @@ test_expect_success 'tests clean up even on failures' " " test_expect_success 'test_atexit is run' " - test_must_fail run_sub_test_lib_test \ + ! run_sub_test_lib_test \ atexit-cleanup 'Run atexit commands' -i <<-\\EOF && test_expect_success 'tests clean up even after a failure' ' > ../../clean-atexit && From patchwork Tue Dec 17 12:01:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11297427 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 70CDD6C1 for ; Tue, 17 Dec 2019 12:01:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4F6B22146E for ; Tue, 17 Dec 2019 12:01:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ate95XjI" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727560AbfLQMBs (ORCPT ); Tue, 17 Dec 2019 07:01:48 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:44891 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727472AbfLQMBr (ORCPT ); Tue, 17 Dec 2019 07:01:47 -0500 Received: by mail-pg1-f193.google.com with SMTP id x7so5542495pgl.11 for ; Tue, 17 Dec 2019 04:01:46 -0800 (PST) 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=bzgvR1Sl23sJ8AQ1hoVe/cwMobweUGRefCQpNp62K1I=; b=ate95XjI2Y8Mntjh4vgdxEVW0HsxxnoYacNmMcr3EGGCc86IPEECtoLNo2J0lFFXp/ lIYwJrf+IVN5L638vTGqGbEz+Ujvg1SnONrzGuraRv5lmqLdbubU7kvuCskAR/EOjKet LcXyQEh4/wBDSieJILFcOc4iblR6XljNR49LKUTQ2ZLHoKy+ACY7iFDh4dAKwcGxDNun BFC7maLNqVLRxeFe8LV5fBJ2w22LJZV2F33NpIA99ZfWfRZs8xMHnaQBujberzZsUl/S 6osLXSxvvEu8O9fbNHRWNeWI5bJptcyvafqAtsjYSIEEzq4UqCKXDV/DKiBBOiQ/70DS hTlQ== 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=bzgvR1Sl23sJ8AQ1hoVe/cwMobweUGRefCQpNp62K1I=; b=aASUsuCpb29myJuCkRlRD7t8lvNhdyh0DpvJW0BAf8KmiOo2OBpF15APMpF2PZUmm8 y+TM16Y2wG1OwPiP2bxihD55f8B4Seqme8ccAI7nLCdgp0qVxsp7x845KGx4Dw5oTkmN lr13GyZCenOA6k3JghG+1AXgBEQa9B5IUMuVT71In0Eyx5NRlYcmanxqHLTUXGh9UB+i fBgc8jSgXrqlKVyTYpFbSf9wjTW/MwyaD8LGXsXhJXkY5bVyrWP9RH/qeSZdbnaZRXPy CzDTIQbMTFeRvUDzYDXHNNwKW85rNG+nQ9U9LvogvuEjProWgPBt2fEGSSvzV/JIbzLc WbvQ== X-Gm-Message-State: APjAAAVLOYG7YRKr12GLtQccXPXF7NvUnTukVU9g9dZLILXKfQzO5qnE S76DGEZgi6kYJ+srugBfvdIMLC1d X-Google-Smtp-Source: APXvYqwHTlFeNmnep8LvrWi0L6LjWTBMhB//tVV02oDcmOb1xeyAO/iwQeFino1wOC7Dm+K3tQx13g== X-Received: by 2002:aa7:9a99:: with SMTP id w25mr21506368pfi.94.1576584106052; Tue, 17 Dec 2019 04:01:46 -0800 (PST) Received: from archbookpro.hsd1.ca.comcast.net ([2601:646:280:1b30:b0bc:639f:d5c8:2bcf]) by smtp.gmail.com with ESMTPSA id a15sm27531723pfh.169.2019.12.17.04.01.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Dec 2019 04:01:45 -0800 (PST) From: Denton Liu To: Git Mailing List Subject: [PATCH 04/15] t0003: use named parameters in attr_check() Date: Tue, 17 Dec 2019 04:01:29 -0800 Message-Id: X-Mailer: git-send-email 2.24.0.627.geba02921db 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 had named the parameters in attr_check() but $2 was being used instead of $expect. Make all variable accesses in attr_check() use named variables instead of numbered arguments for clarity. While we're at it, add variable assignments to the &&-chain. These aren't ever expected to fail but for stylistic purposes, include them anyway for stylistic purposes. Signed-off-by: Denton Liu --- t/t0003-attributes.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/t/t0003-attributes.sh b/t/t0003-attributes.sh index 71e63d8b50..c47d4cfbcd 100755 --- a/t/t0003-attributes.sh +++ b/t/t0003-attributes.sh @@ -5,19 +5,20 @@ test_description=gitattributes . ./test-lib.sh attr_check () { - path="$1" expect="$2" + path="$1" && + expect="$2" && + git_opts="$3" && - git $3 check-attr test -- "$path" >actual 2>err && - echo "$path: test: $2" >expect && + git $git_opts check-attr test -- "$path" >actual 2>err && + echo "$path: test: $expect" >expect && test_cmp expect actual && test_line_count = 0 err } attr_check_quote () { - - path="$1" - quoted_path="$2" - expect="$3" + path="$1" && + quoted_path="$2" && + expect="$3" && git check-attr test -- "$path" >actual && echo "\"$quoted_path\": test: $expect" >expect && From patchwork Tue Dec 17 12:01:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11297425 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 E3AEB930 for ; Tue, 17 Dec 2019 12:01:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C16012082E for ; Tue, 17 Dec 2019 12:01:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="aooH1Iuu" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727573AbfLQMBs (ORCPT ); Tue, 17 Dec 2019 07:01:48 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:45663 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727487AbfLQMBs (ORCPT ); Tue, 17 Dec 2019 07:01:48 -0500 Received: by mail-pg1-f196.google.com with SMTP id b9so5541435pgk.12 for ; Tue, 17 Dec 2019 04:01:47 -0800 (PST) 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=jeGkdMu1Pqnc7Dfg8RYHL7z3t3UcPwW67UTVH0Rr0Ik=; b=aooH1Iuud+n5OaNHJdvjT9DlYaJDUoyYl2oaVlxssOubrVnxK3UDiwm5G3JmcjZhR6 unpbDXWa0FNIDAfohrkdNLgFpEKfykpgnPrhfzKN2Mc4QAv+UV0rDuRe7CsVYJO+58dP xbe6Nrsq2VuzzUGdVH6bn/jlv7MNEDfcmBPObVOzvXidrHDM6TdM6b4MIyVFWJjoY/7G +GlRO0Ezl/+q3z1k7qGbI9GdDP3N3HpTBOaYVg3GAmeqz9R/54LOC7T6Dfrg7RFtg3M9 d0lsWs9tw00SVHI74z/69jcdLA2Q11dBu6vCTeeP1zlXFkgJdco6hBJDeIKaq8gIpWpx rtdg== 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=jeGkdMu1Pqnc7Dfg8RYHL7z3t3UcPwW67UTVH0Rr0Ik=; b=IMFen4tZvKr+AemxD7Bs0r5alKezBWHRxE9/ujxs9fGocM1OvFRA0aulPsNgdIVFA1 K8nkgtlpIP+ZddXAnjPp1LltzEvnsA26A62TA5Z42i3xPWz5fsfzAJAxo3JXirmK7Cnj QtuZwd6CaW1Jpd3LNl/81xG1772Ps+kIvXmzYXce5O/YBg7AZtL4KKU5ZMGOSLcQnV1d MCjQ8sakO3PKeNzefuruE2W10X0v+XuaLLEv/xc2thshJIdP2hpGCnuMfRSLYf6mRpBw dcE1zoIBq3+5fgPj3S3hUXW9bJTEll6KnMBZi7ccEzdr8+9DTa0XoSDwrTJm5lXzkLTm 79Jg== X-Gm-Message-State: APjAAAVZCJ2CSXU87/qnqV647FAhpd7i2dVFacRdI66SVsQwCBJ7ml/s fzCfSjmCxVlVQXvmqdjnJhSm/5S8 X-Google-Smtp-Source: APXvYqweNB2TWhyBOiCX9ALiR+NAITd5kcog1tjmFbnCP5CsNV/9wZe0gWy5mpKST6LCKB4yMZThuA== X-Received: by 2002:a63:3409:: with SMTP id b9mr24618512pga.320.1576584106713; Tue, 17 Dec 2019 04:01:46 -0800 (PST) Received: from archbookpro.hsd1.ca.comcast.net ([2601:646:280:1b30:b0bc:639f:d5c8:2bcf]) by smtp.gmail.com with ESMTPSA id a15sm27531723pfh.169.2019.12.17.04.01.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Dec 2019 04:01:46 -0800 (PST) From: Denton Liu To: Git Mailing List Subject: [PATCH 05/15] t0003: use test_must_be_empty() Date: Tue, 17 Dec 2019 04:01:30 -0800 Message-Id: <055caa5c08d9a53e5e1415d540024d54d0916252.1576583819.git.liu.denton@gmail.com> X-Mailer: git-send-email 2.24.0.627.geba02921db 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 In several places, we used `test_line_count = 0` to check for an empty file. Although this is correct, it's overkill. Use test_must_be_empty() instead because it's more suited for this purpose. Signed-off-by: Denton Liu --- t/t0003-attributes.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/t/t0003-attributes.sh b/t/t0003-attributes.sh index c47d4cfbcd..53a730e2ee 100755 --- a/t/t0003-attributes.sh +++ b/t/t0003-attributes.sh @@ -12,7 +12,7 @@ attr_check () { git $git_opts check-attr test -- "$path" >actual 2>err && echo "$path: test: $expect" >expect && test_cmp expect actual && - test_line_count = 0 err + test_must_be_empty err } attr_check_quote () { @@ -245,7 +245,7 @@ EOF git check-attr foo -- "a/b/f" >>actual 2>>err && git check-attr foo -- "a/b/c/f" >>actual 2>>err && test_cmp expect actual && - test_line_count = 0 err + test_must_be_empty err ' test_expect_success '"**" with no slashes test' ' @@ -266,7 +266,7 @@ EOF git check-attr foo -- "a/b/f" >>actual 2>>err && git check-attr foo -- "a/b/c/f" >>actual 2>>err && test_cmp expect actual && - test_line_count = 0 err + test_must_be_empty err ' test_expect_success 'using --git-dir and --work-tree' ' From patchwork Tue Dec 17 12:01:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11297431 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 D5E3A930 for ; Tue, 17 Dec 2019 12:01:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B2F03207FF for ; Tue, 17 Dec 2019 12:01:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="j0miTALw" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727652AbfLQMBu (ORCPT ); Tue, 17 Dec 2019 07:01:50 -0500 Received: from mail-pg1-f194.google.com ([209.85.215.194]:33008 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727535AbfLQMBs (ORCPT ); Tue, 17 Dec 2019 07:01:48 -0500 Received: by mail-pg1-f194.google.com with SMTP id 6so5570468pgk.0 for ; Tue, 17 Dec 2019 04:01:48 -0800 (PST) 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=5BvE+dUV0tEMUPeGwMeNXRc4OJSkexat6Drb16D/tLo=; b=j0miTALwbtUV3MrItFmwIh8a1Z+9T/kPEPIArAyMmwLLzsD0UvSTluz5D8EnfLhmRz PhTWvzrjNGyc8OH5/p0wEHaWiXeKuiqsTE94Fy5/aLFXVvr5rRIya2cCx44HzRuTzEN9 QWMw3DSA0vVmjnKOQetDTqycgQjkckg7heanoNp4ZG/fODcfKrp/t+h8p5zdQKePChOp B5BAxhBdqaEB9ipVohzBg3GVs0UibNV8HQlJpZ7Ne1tk8M9MrJC6DgR8+Abqv5Qx+Lnt 3EC4ubqTdhXVdOQkMSMMDylrCd7BtIOt7tbtJpXb9+ePnHQENUZ37Y4NZHV6H5/HLdy8 oRVQ== 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=5BvE+dUV0tEMUPeGwMeNXRc4OJSkexat6Drb16D/tLo=; b=DaZEA8NBGe54h9V3+G4ouTWu+3odi5ndvdNINX1hMTFdNb6h7U3twJP/mlqx8IIdIb BFggP3CQoCBoiTyHMaJwZ2CKKcAm5ttezjP8fw1aZ3uVjUveKJ0m1sCQwNlYYcWU/DYK CUfICrZM+7i/XNp6pDanqOJjAyENqtEnxuleMVRObUdeKDx9eZ1xjTODjjzL01wgnVkz KxrcaVWu+hAqzq59t284SKi5FhZx2vGaFmO0hRm9kC8TlTed2EmiNgCxAFb4mQiSIdlp t8c+rD6kJ1EXJJTRhsDN1Sj7/C3FA6chr07cJg1XLAMJOadb0Rmb1PqhxD646Q+zI1m1 bapA== X-Gm-Message-State: APjAAAXXjLysts20Lm0FN3/LUJSHussdz6nWUVSim62fgcOsPAKohjuJ RPgOwVEk+U4nuC6grvhXPuec5xer X-Google-Smtp-Source: APXvYqz4u6fsExPvVkDBZ85StTxxjvhqOLZp3lH6RLZWfmrCvLD3WQYAUH24Cb72ZutvtM/tkyZkqQ== X-Received: by 2002:a63:cc02:: with SMTP id x2mr24914038pgf.114.1576584107457; Tue, 17 Dec 2019 04:01:47 -0800 (PST) Received: from archbookpro.hsd1.ca.comcast.net ([2601:646:280:1b30:b0bc:639f:d5c8:2bcf]) by smtp.gmail.com with ESMTPSA id a15sm27531723pfh.169.2019.12.17.04.01.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Dec 2019 04:01:47 -0800 (PST) From: Denton Liu To: Git Mailing List Subject: [PATCH 06/15] t0003: don't use `test_must_fail attr_check` Date: Tue, 17 Dec 2019 04:01:31 -0800 Message-Id: <3afa3a16ca2fc2fecba19ff9741925d513f68562.1576583819.git.liu.denton@gmail.com> X-Mailer: git-send-email 2.24.0.627.geba02921db 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 In an effort to remove test_must_fail for all invocations not related to git or test-tool, replace invocations of `test_must_fail attr_check` with a plain attr_check call with the $expect argument set to the actual value output by git. Signed-off-by: Denton Liu --- t/t0003-attributes.sh | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/t/t0003-attributes.sh b/t/t0003-attributes.sh index 53a730e2ee..8d4343afdb 100755 --- a/t/t0003-attributes.sh +++ b/t/t0003-attributes.sh @@ -28,7 +28,7 @@ attr_check_quote () { test_expect_success 'open-quoted pathname' ' echo "\"a test=a" >.gitattributes && - test_must_fail attr_check a a + attr_check a unspecified ' @@ -113,20 +113,20 @@ test_expect_success 'attribute test' ' test_expect_success 'attribute matching is case sensitive when core.ignorecase=0' ' - test_must_fail attr_check F f "-c core.ignorecase=0" && - test_must_fail attr_check a/F f "-c core.ignorecase=0" && - test_must_fail attr_check a/c/F f "-c core.ignorecase=0" && - test_must_fail attr_check a/G a/g "-c core.ignorecase=0" && - test_must_fail attr_check a/B/g a/b/g "-c core.ignorecase=0" && - test_must_fail attr_check a/b/G a/b/g "-c core.ignorecase=0" && - test_must_fail attr_check a/b/H a/b/h "-c core.ignorecase=0" && - test_must_fail attr_check a/b/D/g "a/b/d/*" "-c core.ignorecase=0" && - test_must_fail attr_check oNoFf unset "-c core.ignorecase=0" && - test_must_fail attr_check oFfOn set "-c core.ignorecase=0" && + attr_check F unspecified "-c core.ignorecase=0" && + attr_check a/F unspecified "-c core.ignorecase=0" && + attr_check a/c/F unspecified "-c core.ignorecase=0" && + attr_check a/G unspecified "-c core.ignorecase=0" && + attr_check a/B/g a/g "-c core.ignorecase=0" && + attr_check a/b/G unspecified "-c core.ignorecase=0" && + attr_check a/b/H unspecified "-c core.ignorecase=0" && + attr_check a/b/D/g a/g "-c core.ignorecase=0" && + attr_check oNoFf unspecified "-c core.ignorecase=0" && + attr_check oFfOn unspecified "-c core.ignorecase=0" && attr_check NO unspecified "-c core.ignorecase=0" && - test_must_fail attr_check a/b/D/NO "a/b/d/*" "-c core.ignorecase=0" && + attr_check a/b/D/NO unspecified "-c core.ignorecase=0" && attr_check a/b/d/YES a/b/d/* "-c core.ignorecase=0" && - test_must_fail attr_check a/E/f "A/e/F" "-c core.ignorecase=0" + attr_check a/E/f f "-c core.ignorecase=0" ' @@ -150,8 +150,8 @@ test_expect_success 'attribute matching is case insensitive when core.ignorecase ' test_expect_success CASE_INSENSITIVE_FS 'additional case insensitivity tests' ' - test_must_fail attr_check a/B/D/g "a/b/d/*" "-c core.ignorecase=0" && - test_must_fail attr_check A/B/D/NO "a/b/d/*" "-c core.ignorecase=0" && + attr_check a/B/D/g a/g "-c core.ignorecase=0" && + attr_check A/B/D/NO unspecified "-c core.ignorecase=0" && attr_check A/b/h a/b/h "-c core.ignorecase=1" && attr_check a/B/D/g "a/b/d/*" "-c core.ignorecase=1" && attr_check A/B/D/NO "a/b/d/*" "-c core.ignorecase=1" From patchwork Tue Dec 17 12:01:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11297429 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 D351D139A for ; Tue, 17 Dec 2019 12:01:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A70492146E for ; Tue, 17 Dec 2019 12:01:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FIMnsFHl" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727648AbfLQMBt (ORCPT ); Tue, 17 Dec 2019 07:01:49 -0500 Received: from mail-pf1-f173.google.com ([209.85.210.173]:38358 "EHLO mail-pf1-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727487AbfLQMBt (ORCPT ); Tue, 17 Dec 2019 07:01:49 -0500 Received: by mail-pf1-f173.google.com with SMTP id x185so7429579pfc.5 for ; Tue, 17 Dec 2019 04:01:49 -0800 (PST) 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=nKs31bKPqqpEQn/St9HoqdzIChP8ZAjPesmnkKK5QN4=; b=FIMnsFHlpUq+uONkRdwyVVk/jpf6YT7Mj+FrIVXoLk1R6k6L7cbb0AzmL0bPs/NF0c ibL0PmrMYuq5KakZgssszunMdU/b0uEa9lITY2x+VFH6XPpnGZ4GGJfLVB6LiYYgmmaR 0COt8V9pyp0bcRp2iZvLiVu19Pn8/ivCJP45ASRWO/NN3YSS1FrU1bCOA2ChoE1OlOJK BiFNB9KZcyGXlPVadKXneny/e9tmtZN2fbq1T3cz1txDVk/tjsUQwj04QPFviAEKljCn H20sS5NOcZcNoBHhDPJLidWHf61Ry+07P/ogvLHe36mmXKJpWFT7mHNtVUcVt8KpLCIE 6uYQ== 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=nKs31bKPqqpEQn/St9HoqdzIChP8ZAjPesmnkKK5QN4=; b=WRSr1wWrPCIqRgnluKQZd7VCb0s6j89WBPiaVQ1ZzMQ1ANQPD8CIKJCLeNwvRTOwUK XvQNYFCvN5IjBfcHIwjhtzFsCaOGJN/xoLovhW5yScQzJ8Ojm7Xuy4ovc0dwXZccuuIS lv/jc3YLlJs6J4mvmiVZ/+aOfcDQkxyg0D0tOPitO5IDzYs3Q05msyskktACPqbA5T4o wnF+wYCsA73IfeAvtpRz4F+PWAiKVHT6quJx1z+MSICsfCqNnC9p17J7NaifYHgbgfqi 0aKmexVOFJLUvk4W3WU97e/nsOB6mKvIU5hNN6K8WaJLWaZHxPUHTiYSlQpgBKolPoba AWHw== X-Gm-Message-State: APjAAAX1YjIJhiK9jYa4lDrEPOQCE6FiZxloyRPSKD9yI/6l1270EE2O Fk1VMWOURKIcgTJy9stfz/Lv1Mll X-Google-Smtp-Source: APXvYqx9HDaPPnKVZJaAOb9l+Bo5Pw0JTvVKiwpkkbiwkOjvAbJiRT6Or+L4loVYFt8q3DOz7+fB9g== X-Received: by 2002:a63:4f54:: with SMTP id p20mr24868272pgl.246.1576584108240; Tue, 17 Dec 2019 04:01:48 -0800 (PST) Received: from archbookpro.hsd1.ca.comcast.net ([2601:646:280:1b30:b0bc:639f:d5c8:2bcf]) by smtp.gmail.com with ESMTPSA id a15sm27531723pfh.169.2019.12.17.04.01.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Dec 2019 04:01:47 -0800 (PST) From: Denton Liu To: Git Mailing List Subject: [PATCH 07/15] t0020: drop redirections to /dev/null Date: Tue, 17 Dec 2019 04:01:32 -0800 Message-Id: X-Mailer: git-send-email 2.24.0.627.geba02921db 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 Since output is silenced when running without `-v` and debugging output is useful with `-v`, remove redirections to /dev/null as it is not useful. Signed-off-by: Denton Liu --- t/t0020-crlf.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t0020-crlf.sh b/t/t0020-crlf.sh index 854da0ae16..8281babde0 100755 --- a/t/t0020-crlf.sh +++ b/t/t0020-crlf.sh @@ -5,7 +5,7 @@ test_description='CRLF conversion' . ./test-lib.sh has_cr() { - tr '\015' Q <"$1" | grep Q >/dev/null + tr '\015' Q <"$1" | grep Q } # add or remove CRs to disk file in-place From patchwork Tue Dec 17 12:01:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11297433 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 4554A930 for ; Tue, 17 Dec 2019 12:01:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 231452146E for ; Tue, 17 Dec 2019 12:01:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="n19m+5EN" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727673AbfLQMBv (ORCPT ); Tue, 17 Dec 2019 07:01:51 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:40023 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727617AbfLQMBt (ORCPT ); Tue, 17 Dec 2019 07:01:49 -0500 Received: by mail-pg1-f195.google.com with SMTP id k25so5556095pgt.7 for ; Tue, 17 Dec 2019 04:01:49 -0800 (PST) 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=tpUbgt4OCs0Mx0LsvTWXKmwc8VOcR5i+pTPppUKj8No=; b=n19m+5ENwdbbmjhO71zkgTSxnZMU0U1vuw/ePB1iG2zuZ0XYR6PQQmNPyPfmH9tZl7 yQ8u1uni1yJgYttGfsCdOhShZzzMHN9+gbu7Chwk/47DIYj1yCmyomzkdbsn08HfSL4b m/q8Lj0yVXmB+QnFdmz6ABm7u4FRzGnAmynsgebi1zJeQ+LwW1s0E47p73upT98gOG4A NLOuJMSNqSeBQGfEBSqZGDL56Wv+Lx7D9e5+Qm6owC3zA4dsq3fir0xmuHD1ZZU5jjuv E+ZmZpFzcxKnfjE780KFNECL9kPryLzLwNWVblYFhf/wE9qjePAY+Xr5wkm9nmYmZv4d xzGQ== 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=tpUbgt4OCs0Mx0LsvTWXKmwc8VOcR5i+pTPppUKj8No=; b=aXNXmkMl72QRDnZ/v5FEKSLOCJ8pUa1PHuZzEY5XB1pigVHUWKWiS1KRyZ35FRvU1i NjBKtRkZdJ4dQ7omsUPHxKG5DP+w9PPCOMAZVrfCoQ0WXj4psedmJbxdPs9O0suiWAua uoc6niDLCNwECbTPQsAuDx5i9FES30wcC52yjsdcjj3pSZJLPDgXhN03B0ULir4FOKsy I61hRaUbPt19VlguBeORcp9mBRAr5mq21EgIDC0uKvWZxrWw822uNImc2AKXCPnzNPkH ODuDjmfSwgrkxjTEkbyLHUxTI9s6TDJ5bQ/UNHtALQjWcHyEs42ZqXysHWR2s+GITC92 wgdQ== X-Gm-Message-State: APjAAAWXCZUdc5zpRtochooRMTg1Opf/45vrpWVk48PK0oF2CoyO9eZZ PxQXGd8XkLiLfcuUmfc7ccJDpHJe X-Google-Smtp-Source: APXvYqz+k233OwudOrosTSTrOg0auRdv0LeXaHwg6T4lUbmxSXjttQGH0OX0tg07nZ/fkgpuUSJdRQ== X-Received: by 2002:a62:1552:: with SMTP id 79mr21782465pfv.156.1576584108914; Tue, 17 Dec 2019 04:01:48 -0800 (PST) Received: from archbookpro.hsd1.ca.comcast.net ([2601:646:280:1b30:b0bc:639f:d5c8:2bcf]) by smtp.gmail.com with ESMTPSA id a15sm27531723pfh.169.2019.12.17.04.01.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Dec 2019 04:01:48 -0800 (PST) From: Denton Liu To: Git Mailing List Subject: [PATCH 08/15] t0020: s/test_must_fail has_cr/! has_cr/ Date: Tue, 17 Dec 2019 04:01:33 -0800 Message-Id: <8adc5cd5aaeef76ddeef459c79ecec7a05a1fd7b.1576583819.git.liu.denton@gmail.com> X-Mailer: git-send-email 2.24.0.627.geba02921db 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. Since has_cr() just wraps a tr and grep pipeline, replace `test_must_fail has_cr` with `! has_cr`. Signed-off-by: Denton Liu --- t/t0020-crlf.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/t/t0020-crlf.sh b/t/t0020-crlf.sh index 8281babde0..4940e05a2e 100755 --- a/t/t0020-crlf.sh +++ b/t/t0020-crlf.sh @@ -159,8 +159,8 @@ test_expect_success 'checkout with autocrlf=input' ' rm -f tmp one dir/two three && git config core.autocrlf input && git read-tree --reset -u HEAD && - test_must_fail has_cr one && - test_must_fail has_cr dir/two && + ! has_cr one && + ! has_cr dir/two && git update-index -- one dir/two && test "$one" = $(git hash-object --stdin .gitattributes && git read-tree --reset -u HEAD && - test_must_fail has_cr dir/two + ! has_cr dir/two ' test_expect_success '.gitattributes says two and three are text' ' @@ -270,7 +270,7 @@ test_expect_success 'in-tree .gitattributes (1)' ' rm -rf tmp one dir .gitattributes patch.file three && git read-tree --reset -u HEAD && - test_must_fail has_cr one && + ! has_cr one && verbose has_cr three ' @@ -280,7 +280,7 @@ test_expect_success 'in-tree .gitattributes (2)' ' git read-tree --reset HEAD && git checkout-index -f -q -u -a && - test_must_fail has_cr one && + ! has_cr one && verbose has_cr three ' @@ -291,7 +291,7 @@ test_expect_success 'in-tree .gitattributes (3)' ' git checkout-index -u .gitattributes && git checkout-index -u one dir/two three && - test_must_fail has_cr one && + ! has_cr one && verbose has_cr three ' @@ -302,7 +302,7 @@ test_expect_success 'in-tree .gitattributes (4)' ' git checkout-index -u one dir/two three && git checkout-index -u .gitattributes && - test_must_fail has_cr one && + ! has_cr one && verbose has_cr three ' From patchwork Tue Dec 17 12:01:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11297439 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 421E96C1 for ; Tue, 17 Dec 2019 12:01:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1F7AE2082E for ; Tue, 17 Dec 2019 12:01:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="qWS4sKSe" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727717AbfLQMBz (ORCPT ); Tue, 17 Dec 2019 07:01:55 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:36678 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727649AbfLQMBu (ORCPT ); Tue, 17 Dec 2019 07:01:50 -0500 Received: by mail-pg1-f193.google.com with SMTP id k3so5560739pgc.3 for ; Tue, 17 Dec 2019 04:01:50 -0800 (PST) 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=QMPG2hrOQYiAnKUzMMM87GLRpQyF5v0A1WVo4CGCLpM=; b=qWS4sKSeRpBPGh+dcTClhV/4SxIgJwn1Uhbc/wdKf0jTRvJ4kDbbaNRMrjuFUaPFwz lCMrI8TRQG1RO0mjnP4LJMtfd9Ws70PmBd13D1bstvlWV5JRSpU26tgRBOiwEz7jUaXa Mt5c8AT6c7ZSORtTAO+LVbV+fjN+MRCxHakedj89wCLYUry7xc2dLUuiA+McRVp1ebhE AlwU08zvSS67MKN7P6rPA+CRnY6j3/cPofEXF+TVBYcT+MsCUjpJByKng8hJet1FRYmi li4zM7POZqsmHhJC3MFaBxx3TSB2LS6rdR6BhtQCP8QWkmxz8fzb5OhtW+/BhyZmBqyb SaiQ== 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=QMPG2hrOQYiAnKUzMMM87GLRpQyF5v0A1WVo4CGCLpM=; b=PEY+88Cytp3apSPAoisKfycnlIsQRIDnCWEfxraA8xE50cRdAR06a2PqO8e4AIwdl2 1Eopfp7NrqQRgy8GbN4g0YEB1LFrdAqDeNe/2+f2fdDxJX7HFbGuTF9P6T5/CVjGRGA6 4ye0sWUexiZhd7fCCerF3Os5l+hIywkP0tvrxRHV24WZAxcMOr2xL7ceQljF917C9BWa P6atzR91uW+9ij2oGSXnRzoMX8/kWrum329dBXI4celBu326ArYsrwHa5aybLpKPT3r2 oBYKn6sZeZGtKaz642kZ+zNnq1uX+P3VWHOvdoOEX+L79p/VkvSF9umjIgSFN5Rby0fj iWXg== X-Gm-Message-State: APjAAAXxGX4XVC5mp3HfhbQ3WIG08m6CfdKOm5sa+X8oSDKBlXIYo9b7 GiKIhdyHCpxaglitA9uJatjEExN3 X-Google-Smtp-Source: APXvYqyQuZceT2rQ5DeYzX00YwO3B76uM/6s7hZGLBg6TUcmep2NbJPnVlHkJHvJwENP+dbXmRvT6Q== X-Received: by 2002:a62:6187:: with SMTP id v129mr6749064pfb.212.1576584109492; Tue, 17 Dec 2019 04:01:49 -0800 (PST) Received: from archbookpro.hsd1.ca.comcast.net ([2601:646:280:1b30:b0bc:639f:d5c8:2bcf]) by smtp.gmail.com with ESMTPSA id a15sm27531723pfh.169.2019.12.17.04.01.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Dec 2019 04:01:49 -0800 (PST) From: Denton Liu To: Git Mailing List Subject: [PATCH 09/15] t0020: use ! check_packed_refs_marked Date: Tue, 17 Dec 2019 04:01:34 -0800 Message-Id: X-Mailer: git-send-email 2.24.0.627.geba02921db 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. Since check_packed_refs_marked() just wraps a grep invocation, replace `test_must_fail check_packed_refs_marked` with `! check_packed_refs_marked`. Signed-off-by: Denton Liu --- t/t1409-avoid-packing-refs.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/t1409-avoid-packing-refs.sh b/t/t1409-avoid-packing-refs.sh index e5cb8a252d..c46848eb8e 100755 --- a/t/t1409-avoid-packing-refs.sh +++ b/t/t1409-avoid-packing-refs.sh @@ -46,7 +46,7 @@ test_expect_success 'check that marking the packed-refs file works' ' git for-each-ref >actual && test_cmp expected actual && git pack-refs --all && - test_must_fail check_packed_refs_marked && + ! check_packed_refs_marked && git for-each-ref >actual2 && test_cmp expected actual2 ' @@ -80,7 +80,7 @@ test_expect_success 'touch packed-refs on delete of packed' ' git pack-refs --all && mark_packed_refs && git update-ref -d refs/heads/packed-delete && - test_must_fail check_packed_refs_marked + ! check_packed_refs_marked ' test_expect_success 'leave packed-refs untouched on update of loose' ' From patchwork Tue Dec 17 12:01:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11297437 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 2906B930 for ; Tue, 17 Dec 2019 12:01:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 06DF42146E for ; Tue, 17 Dec 2019 12:01:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jqAhIL2T" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727706AbfLQMBx (ORCPT ); Tue, 17 Dec 2019 07:01:53 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:43647 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727656AbfLQMBv (ORCPT ); Tue, 17 Dec 2019 07:01:51 -0500 Received: by mail-pf1-f195.google.com with SMTP id h14so5529013pfe.10 for ; Tue, 17 Dec 2019 04:01:51 -0800 (PST) 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=EMvx28QOUtxXZ96LQ6qQggtpOTuwWkmPV+zOmRtkw9Q=; b=jqAhIL2TJgBIu5FCPxPhdJ0TdkAiezMkx5QqcvlY3kz5giBBY6qKeI4YF3C13932md NUl1CO0bea7RpC/ddGDufEhhiFcKzQsp2hh+R/XEl+3T6AcL8GXD/Sw+aNIyKkKEIqVL Gtb6C7sZwY1GuR/JNsgPlWw39jOQLLlvBf00bAlLFgw0shH1k0Ij3q0jgKzaRSRhki1K yg9sSluhdBvbJyIEl8XOvJiDxBIYOLEFbDpga94WbIe7XI9UeixlEkOIDKxrxVtumB4Z cr1lj2dBrpULi652MqjvQhouc+p7P6WdjW450WA4KXw1sO74VM+Ur4KiC3/vFzxetcG3 4JSQ== 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=EMvx28QOUtxXZ96LQ6qQggtpOTuwWkmPV+zOmRtkw9Q=; b=Cg/Jfz/kxvfvrVua/Xdxrl1jR31RPqX35LF+smOp19oGTyuQ7dvAk1eO3LsefizqRc ZyF6IoYMp7fM09Jl9m7yU297GkE+WIF5hR17/csvhbfBJH6wPlQOBDAI7eKFMJuh014U FUucf7YR2KcoRtIwq07QPr3GYjuAtLuKVZw0rJx1172Ch+TUatQ0DMTyXSrp4//PIYp8 adbdQ3AKzQwzHPtPnrH+JwPCit0XwJK3N2vuEuBkdDCb0/sRg0FyeB8uWEra499uYU0J sqmeKrgYZstK7ZyeblIERb15YS2DLVWO7r7ikMNO1dGe0iOb3eeWiOr2c7JSFqeGBUWL POcg== X-Gm-Message-State: APjAAAVJPgSas7InLJneW93Lb8/eVPUkB7clvhRV2eFPOvfYK0okv87Z Fw+DEAU/SPSROK4rgsiDFyIInFHP X-Google-Smtp-Source: APXvYqweRWu/DP0knN9m1hHH+G85wVzfCYFRm8hSwaoqIW2QRTecx49Ws51ZBnGFAnIOyKe762WfsA== X-Received: by 2002:a63:6c09:: with SMTP id h9mr24249626pgc.34.1576584110579; Tue, 17 Dec 2019 04:01:50 -0800 (PST) Received: from archbookpro.hsd1.ca.comcast.net ([2601:646:280:1b30:b0bc:639f:d5c8:2bcf]) by smtp.gmail.com with ESMTPSA id a15sm27531723pfh.169.2019.12.17.04.01.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Dec 2019 04:01:49 -0800 (PST) From: Denton Liu To: Git Mailing List Subject: [PATCH 10/15] t1306: convert `test_might_fail rm` to `rm -f` Date: Tue, 17 Dec 2019 04:01:35 -0800 Message-Id: X-Mailer: git-send-email 2.24.0.627.geba02921db 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() family of functions (including test_might_fail()) should only be used on git commands. Replace `test_might_fail rm` with `rm -f` so that we don't use `test_might_fail` on a non-git command. Signed-off-by: Denton Liu --- t/t1306-xdg-files.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/t/t1306-xdg-files.sh b/t/t1306-xdg-files.sh index 21e139a313..dd87b43be1 100755 --- a/t/t1306-xdg-files.sh +++ b/t/t1306-xdg-files.sh @@ -153,7 +153,7 @@ test_expect_success 'Checking attributes in both XDG and local attributes files' test_expect_success 'Checking attributes in a non-XDG global attributes file' ' - test_might_fail rm .gitattributes && + rm -f .gitattributes && echo "f attr_f=test" >"$HOME"/my_gitattributes && git config core.attributesfile "$HOME"/my_gitattributes && echo "f: attr_f: test" >expected && @@ -165,7 +165,7 @@ test_expect_success 'Checking attributes in a non-XDG global attributes file' ' test_expect_success 'write: xdg file exists and ~/.gitconfig doesn'\''t' ' mkdir -p "$HOME"/.config/git && >"$HOME"/.config/git/config && - test_might_fail rm "$HOME"/.gitconfig && + rm -f "$HOME"/.gitconfig && git config --global user.name "write_config" && echo "[user]" >expected && echo " name = write_config" >>expected && @@ -183,8 +183,8 @@ test_expect_success 'write: xdg file exists and ~/.gitconfig exists' ' test_expect_success 'write: ~/.config/git/ exists and config file doesn'\''t' ' - test_might_fail rm "$HOME"/.gitconfig && - test_might_fail rm "$HOME"/.config/git/config && + rm -f "$HOME"/.gitconfig && + rm -f "$HOME"/.config/git/config && git config --global user.name "write_gitconfig" && echo "[user]" >expected && echo " name = write_gitconfig" >>expected && From patchwork Tue Dec 17 12:01: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: 11297435 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 AC9206C1 for ; Tue, 17 Dec 2019 12:01:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8A3902082E for ; Tue, 17 Dec 2019 12:01:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="qlh6QTMM" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727691AbfLQMBx (ORCPT ); Tue, 17 Dec 2019 07:01:53 -0500 Received: from mail-pj1-f67.google.com ([209.85.216.67]:34101 "EHLO mail-pj1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727617AbfLQMBw (ORCPT ); Tue, 17 Dec 2019 07:01:52 -0500 Received: by mail-pj1-f67.google.com with SMTP id j11so4497977pjs.1 for ; Tue, 17 Dec 2019 04:01:51 -0800 (PST) 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=CAkrqt19tr4PU/c0NR+jni1gYZ5EFpMiOfpujG+skJw=; b=qlh6QTMMyfntv/5BQX8dxbz70nKhEWQRRQnH+EOZyuKdTdeRMh9a8oejq7JaQbroeo LJmN7nmewLxsv5dZvBVVrKRjnWyUzQz1gV91Y9AZjoeKHVfagieQ6YDYey4DETSa9072 8FgMXnV5LeEAtHjdmTtmCcobvU9Ck0OGcqTrykwLBOF1fssUCaSV3wKKycNNhPR6JkQd GV5FCcEJhbuc2jUFCFpKokUyXhRkUOmCgScEXlWqJJFjoMihXobf9RPSkF3W481wgvGm PpWcLs+pPG1vn7x2ybo5PQ8OjSao6JO6X7KAT9xTz5t5PLhHWWoXmLP3RkQUraLl9U9W GW6A== 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=CAkrqt19tr4PU/c0NR+jni1gYZ5EFpMiOfpujG+skJw=; b=Yr7Lj+Y789vDyoREnxrQL7zzBqHBJxJAC/BVK53k1dV8VIH8p+omII+eOmi1KI4LAS yJsYDQvCtQ2F7mV0dtqCHxGE853WsQNZY3oW1/jPVAXNSDS8f52kwH/e28SAjWA01iwo GtRYlL04AwhZsVfRQNJ+WIyKNU4CVVq7yJShZH4OzMweZ+cC4qh5wYYuuYG0PdorHlS5 5omd9C5MsifuLAr+KvtXbpThhcYb2vd6rvBkL4pO2TfhshnSpmTNc0fHwlqb0fZXcWqH 9n/aRaybYUJX6WaZmyBPO+lKauTtvo7UDSUxMnDWD6F6orKMTRqIyIsZ8C9vbOrVyv9A 86IQ== X-Gm-Message-State: APjAAAVakKdmkT2aumhOd/Jio65P9R8Q2wwGIlyjwdtKnwYxeVfL+a+b gDjCwX8Zl9lCbqKlYZmmbTjdY0Gq X-Google-Smtp-Source: APXvYqxHuTPLfRZrOwGeP7VJXTakcVi2OyutU6MmTtA55xVAWaDNdPe/DTE0wGi6z+5iw3RO61Ki8A== X-Received: by 2002:a17:902:be02:: with SMTP id r2mr21274154pls.76.1576584111222; Tue, 17 Dec 2019 04:01:51 -0800 (PST) Received: from archbookpro.hsd1.ca.comcast.net ([2601:646:280:1b30:b0bc:639f:d5c8:2bcf]) by smtp.gmail.com with ESMTPSA id a15sm27531723pfh.169.2019.12.17.04.01.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Dec 2019 04:01:50 -0800 (PST) From: Denton Liu To: Git Mailing List Subject: [PATCH 11/15] t1307: reorder `nongit test_must_fail` Date: Tue, 17 Dec 2019 04:01:36 -0800 Message-Id: <2dd91c5568835f8263d18db62c787deb1eeb1650.1576583819.git.liu.denton@gmail.com> X-Mailer: git-send-email 2.24.0.627.geba02921db 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 In the future, we plan on only allowing `test_must_fail` to work on a restricted subset of commands, including `git`. Reorder the commands so that `nongit` comes before `test_must_fail`. This way, `test_must_fail` operates on a git command. Signed-off-by: Denton Liu --- t/t1307-config-blob.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t1307-config-blob.sh b/t/t1307-config-blob.sh index 37dc689d8c..002e6d3388 100755 --- a/t/t1307-config-blob.sh +++ b/t/t1307-config-blob.sh @@ -74,7 +74,7 @@ test_expect_success 'can parse blob ending with CR' ' ' test_expect_success 'config --blob outside of a repository is an error' ' - test_must_fail nongit git config --blob=foo --list + nongit test_must_fail git config --blob=foo --list ' test_done From patchwork Tue Dec 17 12:01: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: 11297447 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 5C407139A for ; Tue, 17 Dec 2019 12:02:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2F2E92146E for ; Tue, 17 Dec 2019 12:02:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="AHxxMNuQ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727761AbfLQMB6 (ORCPT ); Tue, 17 Dec 2019 07:01:58 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:34479 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726709AbfLQMBw (ORCPT ); Tue, 17 Dec 2019 07:01:52 -0500 Received: by mail-pf1-f193.google.com with SMTP id l127so5642288pfl.1 for ; Tue, 17 Dec 2019 04:01:52 -0800 (PST) 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=afpKYb9KH9PSYs6ZS7QULiLYjGm9fTj9ThuhSVylIoY=; b=AHxxMNuQ0qJ27hF86Il1SKqYaa47P/U/0bfglGSnPlx91lgQ5yjZ5vC5ED/1FPhfqg UIofs6/rqbr/mGqdQrfEBklsE3C6mrJqYBcu3f1fWJ9lhZ3ePmfx1B59OYgf7O5u70Mz I4saQFOl2z2RSpvaYra6+WV+MijuNiq8XqssiRub1GQOaEOhTp+SEjB5KHD6yJoGzlrq B1XFR0qjQ/tAETaZhG3gIWNqBDCcjz75oaUdCkC52M55BFlCPaPgEdNQwvHWBG1xK7zi zLr3qNpNReB5quTIgTvKaUgt26qp8jjNFrrM4QtVB0A69dPcIxFCWD4o6laz9/daZacO EHlg== 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=afpKYb9KH9PSYs6ZS7QULiLYjGm9fTj9ThuhSVylIoY=; b=Pqx2zmhzKZD/TdWc23yGHkhdp/0WfpORiEC29y4HTYNZ3JNWgOodWPImAFPvaR4EGW etS4Zv22DNzYQzlGTkaqHmiVIUnv7QLphwmuulZHkJ9QXz0w8gC43wPoeTbMdTkbeht6 qyXui5S+c3u9NkkX8UyAihaiVnyILASJZiI6QgHYw44kRmjG/FN5yDZlGEk45X+v0EQz /IcYjHkteC2WzY0irJmnSrTRMHOaxqt+mvxyechewiolQszEKyZ9wWRFN1FCTjtZK9pi PxJ+v+mOBP6/QdAXnZN40ihyN2x7fFOKmbtgclaK8I2ehFUn4WswmT80sb/OqBauJ+1b EDzA== X-Gm-Message-State: APjAAAVZ7H8d8o09P9MZCrm66XZ6dTWbAzfjwJjAweMRnCHn+6ulVhAE mNSEvsEOc5BXDysnfCesa/v9/d9F X-Google-Smtp-Source: APXvYqxPTz8khZJY592DrYARxVQbDk0NSORft8Z5RKoyRpwb8unawvP8EuHXkSMGIXjy6/3V86yplg== X-Received: by 2002:a63:ce50:: with SMTP id r16mr24652737pgi.32.1576584111880; Tue, 17 Dec 2019 04:01:51 -0800 (PST) Received: from archbookpro.hsd1.ca.comcast.net ([2601:646:280:1b30:b0bc:639f:d5c8:2bcf]) by smtp.gmail.com with ESMTPSA id a15sm27531723pfh.169.2019.12.17.04.01.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Dec 2019 04:01:51 -0800 (PST) From: Denton Liu To: Git Mailing List Subject: [PATCH 12/15] t1409: let sed open its own files Date: Tue, 17 Dec 2019 04:01:37 -0800 Message-Id: <0b7d19a7e1498238f3d6d4d9bb07b3345cbb345f.1576583819.git.liu.denton@gmail.com> X-Mailer: git-send-email 2.24.0.627.geba02921db 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 In one case, we were using a redirection operator to feed input into sed. However, since sed is capable of opening its own files, make sed open its own files instead of redirecting input into it. Signed-off-by: Denton Liu --- t/t1409-avoid-packing-refs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t1409-avoid-packing-refs.sh b/t/t1409-avoid-packing-refs.sh index c46848eb8e..f74d890e82 100755 --- a/t/t1409-avoid-packing-refs.sh +++ b/t/t1409-avoid-packing-refs.sh @@ -8,7 +8,7 @@ test_description='avoid rewriting packed-refs unnecessarily' # shouldn't upset readers, and it should be omitted if the file is # ever rewritten. mark_packed_refs () { - sed -e "s/^\(#.*\)/\1 t1409 /" <.git/packed-refs >.git/packed-refs.new && + sed -e "s/^\(#.*\)/\1 t1409 /" .git/packed-refs >.git/packed-refs.new && mv .git/packed-refs.new .git/packed-refs } From patchwork Tue Dec 17 12:01: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: 11297441 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 3B9506C1 for ; Tue, 17 Dec 2019 12:01:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1A2A32146E for ; Tue, 17 Dec 2019 12:01:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="h0tezVXp" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727735AbfLQMB4 (ORCPT ); Tue, 17 Dec 2019 07:01:56 -0500 Received: from mail-pj1-f67.google.com ([209.85.216.67]:35188 "EHLO mail-pj1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727617AbfLQMBx (ORCPT ); Tue, 17 Dec 2019 07:01:53 -0500 Received: by mail-pj1-f67.google.com with SMTP id w23so4495551pjd.2 for ; Tue, 17 Dec 2019 04:01:53 -0800 (PST) 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=8XNbQ+GgBYygTvD2vAIrwNfJPbbfGy3wwVKh2xbuCM0=; b=h0tezVXpKUc8vblQwEJc2hStPsKdHaGwSavF0tDa8lgKoWvuWurSoQysIQkOYRYZqL fzXpPmUfZiYz9/sr/yWP4R5uAQ6jFwQcY6JoZrgDER0gbvFhV94fwmDAujIHzM2Ikq0k 0EntQ1gw/7eRf39aWam0/jC3qfWET7CS8U/x6yN9EmPTrTAGe2g+eJfDFsEe/FmjfwTZ voML/9owE3FIdL9rrywFkLdzJWHUuC0QG1FKrEE0ZKqar+CLOmbrbR933pzgWE8aIWkU v3VtOX0iXek/jO7956hRX0+ETvwTKtSbOWvEyUjLod4JMfJ4Y3I59oQKHW0rXoBnSzTL L6bw== 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=8XNbQ+GgBYygTvD2vAIrwNfJPbbfGy3wwVKh2xbuCM0=; b=kboI5S++W3SuDKB8/FMUuq3ZKALLfsk+MDH1kCpOVQHKSOt1wnNXQ6LahWFMRpHaWF VVo/ucdWrOg/IZ+bhq19TfaIO9J1pVQvJX/y8MuswSBEm8fRYHWkRif3IerbdpeJa2zH KGwP/E/vgo4nqjw1SL0YDv+0E1fpHTwvd22OixNb8ykIku3ACtB+lYHvuV7Q9N3gWuMG UIIgV/A2UdeffPTB7b68b1T6jc1DnJIkJtleOdYP3vtSZLMx53a9CcNQCpO8SoyKzfAE EtvqZLiTTn6d88JgceaekXpm2cr3cKjYoc9MXzSAnSBRSzXQWxNFAHvXpCoNb+BqEq9e uhvw== X-Gm-Message-State: APjAAAX1zJqWaRwMaHdBgsn/KhbhijnGNlt/l5G0O4g8Ljk+EG+JR7WF mda5viSeIqncfeZyDNqSkcc0O7ER X-Google-Smtp-Source: APXvYqzD6r+fCOqti0q94wD73QsnNT4JlyFa7dltsGvMxS1qeAbgPhwdBm5AwWyDzJWkdI+PSxE9Vw== X-Received: by 2002:a17:902:5a83:: with SMTP id r3mr22698614pli.145.1576584112517; Tue, 17 Dec 2019 04:01:52 -0800 (PST) Received: from archbookpro.hsd1.ca.comcast.net ([2601:646:280:1b30:b0bc:639f:d5c8:2bcf]) by smtp.gmail.com with ESMTPSA id a15sm27531723pfh.169.2019.12.17.04.01.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Dec 2019 04:01:52 -0800 (PST) From: Denton Liu To: Git Mailing List Subject: [PATCH 13/15] t1409: use test_path_is_missing() Date: Tue, 17 Dec 2019 04:01:38 -0800 Message-Id: <27b32962427e5b74569b08dc4c0de40b67388615.1576583819.git.liu.denton@gmail.com> X-Mailer: git-send-email 2.24.0.627.geba02921db 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 -f` with `test_path_is_missing` since we expect these files to not exist. Signed-off-by: Denton Liu --- t/t1409-avoid-packing-refs.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/t/t1409-avoid-packing-refs.sh b/t/t1409-avoid-packing-refs.sh index f74d890e82..be12fb6350 100755 --- a/t/t1409-avoid-packing-refs.sh +++ b/t/t1409-avoid-packing-refs.sh @@ -27,15 +27,15 @@ test_expect_success 'setup' ' ' test_expect_success 'do not create packed-refs file gratuitously' ' - test_must_fail test -f .git/packed-refs && + test_path_is_missing .git/packed-refs && git update-ref refs/heads/foo $A && - test_must_fail test -f .git/packed-refs && + test_path_is_missing .git/packed-refs && git update-ref refs/heads/foo $B && - test_must_fail test -f .git/packed-refs && + test_path_is_missing .git/packed-refs && git update-ref refs/heads/foo $C $B && - test_must_fail test -f .git/packed-refs && + test_path_is_missing .git/packed-refs && git update-ref -d refs/heads/foo && - test_must_fail test -f .git/packed-refs + test_path_is_missing .git/packed-refs ' test_expect_success 'check that marking the packed-refs file works' ' From patchwork Tue Dec 17 12:01:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11297443 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 8E39E930 for ; Tue, 17 Dec 2019 12:01:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6C8C12146E for ; Tue, 17 Dec 2019 12:01:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UQ/ylk7j" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727746AbfLQMB4 (ORCPT ); Tue, 17 Dec 2019 07:01:56 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:44985 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727707AbfLQMBy (ORCPT ); Tue, 17 Dec 2019 07:01:54 -0500 Received: by mail-pf1-f193.google.com with SMTP id d199so7414863pfd.11 for ; Tue, 17 Dec 2019 04:01:53 -0800 (PST) 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=xbfAXn74Dj6IEWvOst/CxgC1juY7ioFICG2DQe/nYfk=; b=UQ/ylk7jp44S1WrDMh6NL5hb10MTZUnLMam9ecZ1kJ82McZ+Qzftv0ZtWIYJk9esyA joMHA6eleqsR+4GsMxHpcAH3SIizPWeaoWcAnf2VFJ+JYtBzsFp31iezanz3iQmUPgJ+ 9cfcDUZNeJ5vxqp1pan/fXsE3hN7g4w2jC2xnKKz4H5WvBCIt0Bj/GVLt7wbJH3oS3Zw q4XzmHKvZd4w93Ptm9VTxuHebIyA4BN9fCdPGEkp7ko49y1x6DPxIriPbvmRYjGC4E3W sQ6luMv8CfDASb6RoeB0zaYWdIglaODuk6TTx4L5cxrpqVTnEFEHgvjeKSZAC6goqf/C nWqw== 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=xbfAXn74Dj6IEWvOst/CxgC1juY7ioFICG2DQe/nYfk=; b=ksKzLkDjxbSzf8NFJbVk7ApqAH2Nt8Oj2Y7GaErhgbDpYALhPMbKq6azKPaTCufWUT AsmMp8nwhKywl4O79ud9S8wPe1VHSGZ/NzyA1M0afO57TkJdeEksKoCrMVBh8oQbVL9i p/sGInksYXAo1zQpK9Di01zASpOX2KykTTPAwtdft8C1xVr870G1WL4YqL10LhTmqejg F0zyN8H0dXO8nW+AhHigyu+CPDD/ncm7FPnpxITLUmtFet0eImzNnkjKzR8ac60DgcbF H4PBtDXdSoQ+Ym2AQHDDKULP+8WaAf/C8/agMbkTE3I/9QfiOPkcuU4YMI20F9PgQl1/ +b/g== X-Gm-Message-State: APjAAAWX1SVtf8PeIK5cMKs5JFWEY1IrR/6975CBguR6J2wZzFxDXSta KW5OIz5N1GvwFmdy75TPbkC3LjTo X-Google-Smtp-Source: APXvYqx0ZcaM4jJgA1BZEnBZsGOLJhapIsawsUu2hkqAHGte9DYIVEjcvxQhweEJlSYsMas8fC9SBA== X-Received: by 2002:a63:d406:: with SMTP id a6mr24989599pgh.264.1576584113161; Tue, 17 Dec 2019 04:01:53 -0800 (PST) Received: from archbookpro.hsd1.ca.comcast.net ([2601:646:280:1b30:b0bc:639f:d5c8:2bcf]) by smtp.gmail.com with ESMTPSA id a15sm27531723pfh.169.2019.12.17.04.01.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Dec 2019 04:01:52 -0800 (PST) From: Denton Liu To: Git Mailing List Subject: [PATCH 14/15] t1501: remove use of `test_might_fail cp` Date: Tue, 17 Dec 2019 04:01:39 -0800 Message-Id: <3d36511d5d95d2a2713b3cc8e2138b689d381c79.1576583819.git.liu.denton@gmail.com> X-Mailer: git-send-email 2.24.0.627.geba02921db 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() family of functions (including test_might_fail()) should only be used on git commands. Replace test_might_fail() with test_non_git_might_fail(). Signed-off-by: Denton Liu --- t/t1501-work-tree.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t1501-work-tree.sh b/t/t1501-work-tree.sh index 3498d3d55e..067301a5ab 100755 --- a/t/t1501-work-tree.sh +++ b/t/t1501-work-tree.sh @@ -350,7 +350,7 @@ test_expect_success 'Multi-worktree setup' ' mkdir work && mkdir -p repo.git/repos/foo && cp repo.git/HEAD repo.git/index repo.git/repos/foo && - test_might_fail cp repo.git/sharedindex.* repo.git/repos/foo && + test_non_git_might_fail cp repo.git/sharedindex.* repo.git/repos/foo && sane_unset GIT_DIR GIT_CONFIG GIT_WORK_TREE ' From patchwork Tue Dec 17 12:01:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11297445 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 C3B9A6C1 for ; Tue, 17 Dec 2019 12:01:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A22D82146E for ; Tue, 17 Dec 2019 12:01:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BsGaO4Nl" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727751AbfLQMB6 (ORCPT ); Tue, 17 Dec 2019 07:01:58 -0500 Received: from mail-pg1-f194.google.com ([209.85.215.194]:35491 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727656AbfLQMBz (ORCPT ); Tue, 17 Dec 2019 07:01:55 -0500 Received: by mail-pg1-f194.google.com with SMTP id l24so5566432pgk.2 for ; Tue, 17 Dec 2019 04:01:54 -0800 (PST) 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=OzdOyb95QcnDOwcg5SuGULBKy8d/XRonQyY8fjL4CS4=; b=BsGaO4NlTAHJlm14Gc2FKFhmZX+bXSOvmOGyWLTmmr7zgm7MZH3cC93cqpe0D5jMuQ Y3m1m5YyelRRQeblPP6WUxTvv9AdlCwuJuir02icsxV4zfqLy0URnlyQ9fky+PqXGHfP gp3aYFYDRj2Wd0oKzmWs0eWD5Tv1k81GRdXMRt/hmIv2X+4NgH2jwx2K2VNaBXPut/YU L2Myu2SWZSSTWyTttbBYpI1vMVpi/MmHiYs+A+SQG2615ZN676ud4cF2A9JWSvwjOeG8 +9vU+0b2rNVKd+UbJNURlmdbmYbod6Bq/uHVR/+Tn5+cDYI/DtCLjKeFGzQufXOhoWhA 0QvA== 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=OzdOyb95QcnDOwcg5SuGULBKy8d/XRonQyY8fjL4CS4=; b=HaRfgF/puuVAM4ISA28HGrN7iho5xKYb58QLo83qVGwaZUan1hvGFHFgOBA/ve/eCr UHYs1zz+y6HxIOeGWBoEvq3uKMAM9qacTkajYObK0i80qHyltG4Vh8waQnoV5UiM2+01 IOmey0S7j4iq4K5V4HAZry0FfEpm43mPFmd5XyiZfj5asDySjqWvZDKRyuUW6bfgI8G3 L1xhyBgXNCLTBRJzxZW6PlrrziVZHmZTG5KesQTqYYLViDCLWea1xMG5etgQQ8VYnAVV ZZKoKPJIr9Ngm+6wBYRBzXwvOz/ElyWNma4U0RKW+HgJhNem2lc6XYclk2Wc1E5kqO2K 2Vtg== X-Gm-Message-State: APjAAAWchEn4ylR5Sv+iFmdGNBBB8mwYUvDAfqqkerzwTbgrFGyGYMjW WsBIk2shtvXj9DOy7GuastwiJBDX X-Google-Smtp-Source: APXvYqwHX9XHvc7NrNIV/sB8z/MLY6gVYAub+xCCYCVoDs6EUK33UH3zOpPCisoqugaJuqFbW2cCYw== X-Received: by 2002:a63:215d:: with SMTP id s29mr22758634pgm.200.1576584113808; Tue, 17 Dec 2019 04:01:53 -0800 (PST) Received: from archbookpro.hsd1.ca.comcast.net ([2601:646:280:1b30:b0bc:639f:d5c8:2bcf]) by smtp.gmail.com with ESMTPSA id a15sm27531723pfh.169.2019.12.17.04.01.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Dec 2019 04:01:53 -0800 (PST) From: Denton Liu To: Git Mailing List Subject: [PATCH 15/15] t1507: teach full_name() to accept `!` arg Date: Tue, 17 Dec 2019 04:01:40 -0800 Message-Id: X-Mailer: git-send-email 2.24.0.627.geba02921db 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 Before, we were running `test_must_fail full_name`. However, `test_must_fail` should only be used on git commands. Teach full_name() to accept `!` as a potential first argument which will prepend `test_must_fail` to the enclosed git command. This increases the granularity of test_must_fail since it no longer runs on the `cd` as well. Signed-off-by: Denton Liu --- t/t1507-rev-parse-upstream.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/t/t1507-rev-parse-upstream.sh b/t/t1507-rev-parse-upstream.sh index 8b4cf8a6e3..9a941d68d8 100755 --- a/t/t1507-rev-parse-upstream.sh +++ b/t/t1507-rev-parse-upstream.sh @@ -29,8 +29,14 @@ test_expect_success 'setup' ' ' full_name () { + fail= && + if test "x$1" = 'x!' + then + fail=test_must_fail && + shift + fi && (cd clone && - git rev-parse --symbolic-full-name "$@") + $fail git rev-parse --symbolic-full-name "$@") } commit_subject () { @@ -79,7 +85,7 @@ test_expect_success 'upstream of branch with @ at end' ' ' test_expect_success 'refs/heads/my-side@{upstream} does not resolve to my-side{upstream}' ' - test_must_fail full_name refs/heads/my-side@{upstream} + full_name ! refs/heads/my-side@{upstream} ' test_expect_success 'my-side@{u} resolves to correct commit' ' @@ -91,9 +97,9 @@ test_expect_success 'my-side@{u} resolves to correct commit' ' ' test_expect_success 'not-tracking@{u} fails' ' - test_must_fail full_name non-tracking@{u} && + full_name ! non-tracking@{u} && (cd clone && git checkout --no-track -b non-tracking) && - test_must_fail full_name non-tracking@{u} + full_name ! non-tracking@{u} ' test_expect_success '@{u}@{1} resolves correctly' '