From patchwork Thu Mar 26 08:27:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11459593 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 C804417EA for ; Thu, 26 Mar 2020 08:28:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A645B2078E for ; Thu, 26 Mar 2020 08:28:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WuJY6+F8" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727702AbgCZI2R (ORCPT ); Thu, 26 Mar 2020 04:28:17 -0400 Received: from mail-qv1-f46.google.com ([209.85.219.46]:33623 "EHLO mail-qv1-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727682AbgCZI2R (ORCPT ); Thu, 26 Mar 2020 04:28:17 -0400 Received: by mail-qv1-f46.google.com with SMTP id p19so2506853qve.0 for ; Thu, 26 Mar 2020 01:28:16 -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=4jymsQpxanrvM7CdWabBQETlbYp4h+uHC9F0qbhN6ag=; b=WuJY6+F8IVmCLd5/Ffd7xClODXp12dBbURgKQXiP7Ak2M09AOmfjeijijlq74nM1PB TgiqCdHDCNg9sAtqSU3b5kVGmzq2prhcay+8ZdOo0JipZBoYPHpR9NPGIOHoTSEUOnx4 RSiVa5v7xmIGq1Cvppj/KcpsgCsExXs6OXLoo6L4g2X9LFR1gNZfoUTBJZqFmUWFkTrJ zJ6tIfUy0TRF3irkdzc2fQn9KDYyfidP5c70RQH2eQSuCsRjH615CLQ+uQB/x9GnSg/8 Jt0xTyPivxiQBZh/ZgemnbIGUeQZgT3xI4q5VIB3EAqr+iUzihjC1+VcZmJOX5ZZYRUh s1ww== 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=4jymsQpxanrvM7CdWabBQETlbYp4h+uHC9F0qbhN6ag=; b=BjZARNFjNvH8ivK4wtD//aLeB0s6ClhRpVu97IDcF8j7SJQJApvGfG1hfef3V+K31a +DQtJWffncWen8d/uqhTbKrTNclzKLZ5pWnai0HpnHaUwz04t7IL5GbmN3h4RE9VZUuL v3SPr7uhg9Rpw0SLtaV9SMqEGcST9QYGvg3v/nUKNFWTA3M7wbtRh/esZUyZTPStfKj7 09Zyjh0RGz+dSQplC6qJPjDcvlFNdsp36QZy5YKEbiYiskC8DzI3yyhLOIQfYNmCDssW hiOK9JyekwsUm2Hl6mPeNHpM4/jqVIXyWUYBZcPN+/TDnR+KlU25Rmbo0bxzJmqeAhfy qjuQ== X-Gm-Message-State: ANhLgQ3VmqH67HGZp33w5GbZvokv3JMML4kDensKxNgNo4YLV5GvUv32 Lp8Xw/r6mnHEd+NHtxKXiE1HKxuq X-Google-Smtp-Source: ADFU+vuvtniglwUq4Y1sfdjfe4tGBH61XCeZvLJtU3VHrLV86FujIsY/I970ySooE29g5/cveWvPhA== X-Received: by 2002:ad4:5a05:: with SMTP id ei5mr7106492qvb.127.1585211295959; Thu, 26 Mar 2020 01:28:15 -0700 (PDT) Received: from archbookpro.lan ([199.249.110.29]) by smtp.gmail.com with ESMTPSA id g187sm935789qkf.115.2020.03.26.01.28.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 01:28:15 -0700 (PDT) From: Denton Liu To: Git Mailing List Subject: [PATCH v2 1/8] t5512: don't use `test_must_fail test_cmp` Date: Thu, 26 Mar 2020 04:27:48 -0400 Message-Id: <3d7dc8428d1992d3bc2802f5c828e8d77fe4de3b.1585209554.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 should 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/t5512-ls-remote.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t5512-ls-remote.sh b/t/t5512-ls-remote.sh index 04b35402c7..08b98f12b8 100755 --- a/t/t5512-ls-remote.sh +++ b/t/t5512-ls-remote.sh @@ -92,7 +92,7 @@ test_expect_success 'use "origin" when no remote specified' ' test_expect_success 'suppress "From " with -q' ' git ls-remote -q 2>actual_err && - test_must_fail test_cmp exp_err actual_err + ! test_cmp exp_err actual_err ' test_expect_success 'use branch..remote if possible' ' From patchwork Thu Mar 26 08:27:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11459595 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 8906E1668 for ; Thu, 26 Mar 2020 08:28:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6AC3820772 for ; Thu, 26 Mar 2020 08:28:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="B0oQvCgX" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727717AbgCZI2T (ORCPT ); Thu, 26 Mar 2020 04:28:19 -0400 Received: from mail-qt1-f169.google.com ([209.85.160.169]:33503 "EHLO mail-qt1-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727682AbgCZI2S (ORCPT ); Thu, 26 Mar 2020 04:28:18 -0400 Received: by mail-qt1-f169.google.com with SMTP id c14so4598608qtp.0 for ; Thu, 26 Mar 2020 01:28:18 -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=Xmt/ZdvBmrODrpbs2I8e0SBEBAFkBWWfWCeg2U1NQcg=; b=B0oQvCgXQR0Sr3/pE8lDQ9T7NUz7GudGNt4JOdG2eh6xqubKL47Nx0+EhLsv8NISYu 19MQzQQOJoDB7cMTjPCJwgtlsCp23PoxFQhjgeqiTifC8cVlgvwHPCfESxKjEM/Njl6q TvoOWfhTfZKbikWufxrWloqLNdMrW3z6rgc4HWXVrIfOLKY+zMXKQARwbOruq9/EFVG4 foFaRiHKMpMFhyAJMwuorCL5Py1CKk/UNCqk0RIiXRCisqvOo7kfUKPU5wiFvOOmE+AB NND+K6rq4aeaFMHu/pudkmWe6C0D7HGSQBRnFxk9J8RGie9iC8qC3VbhsUljH6KPSX5+ K3Mw== 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=Xmt/ZdvBmrODrpbs2I8e0SBEBAFkBWWfWCeg2U1NQcg=; b=TrA9fYiNvukiCdWfm38fwa6o4G/CSFVMSpjG1kDhTPH0TqR+/56vXNwrBggkGMPWaK F8olat/H0sRbkJQcsP3fRmwIwTynhdIcyqPvBnoI5FuV7Hr8WScoZHQWb7ZcE6MYpiXm dMOXvJOhbEj+ujB/5hevAmPrEayJgLF/+nfnjnHzHjxjftcWx39hurqq+MUYdEXhepBl gxyI8gW9lgwNl19PgOnnBWMTMZhOtdYl/ycJzzN9QNWgK0iX8eXewRyvg5iqdmEFDPlM BiaaBYvXfY/OQLyq+unVLdJGuqf2HqB5Hdv9yMBYaD7/jCxO2moarPvo8SIUZhrokcGg 8ajw== X-Gm-Message-State: ANhLgQ2ones6vLQiLbi/heKCpCVleyjXvoSYK9AUrXIeqH1k9GFMxpBL 2S8l7pKVcypMz+pirbzPPSKLRWjo X-Google-Smtp-Source: ADFU+vtil+37qwJBk24+fMODGDI4y+cPT1WTCECCRCp56RvZUmOyqrVYTrXkn4DB68QK7rqFxRzS4Q== X-Received: by 2002:ac8:41cd:: with SMTP id o13mr6976759qtm.266.1585211297017; Thu, 26 Mar 2020 01:28:17 -0700 (PDT) Received: from archbookpro.lan ([199.249.110.29]) by smtp.gmail.com with ESMTPSA id g187sm935789qkf.115.2020.03.26.01.28.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 01:28:16 -0700 (PDT) From: Denton Liu To: Git Mailing List Subject: [PATCH v2 2/8] t5512: stop losing git exit code in here-docs Date: Thu, 26 Mar 2020 04:27:49 -0400 Message-Id: <97bc46e4a9105f13b5284f86907eb1459a9987b6.1585209554.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 expected references are generated using a here-doc with some inline command substitutions. If one of the `git rev-parse` invocations within the command substitutions fails, its return code is swallowed and we won't know about it. Replace these command substitutions with generate_references(), which actually reports when `git rev-parse` fails. Signed-off-by: Denton Liu --- t/t5512-ls-remote.sh | 64 ++++++++++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 29 deletions(-) diff --git a/t/t5512-ls-remote.sh b/t/t5512-ls-remote.sh index 08b98f12b8..dcb7349b0b 100755 --- a/t/t5512-ls-remote.sh +++ b/t/t5512-ls-remote.sh @@ -4,6 +4,14 @@ test_description='git ls-remote' . ./test-lib.sh +generate_references () { + for ref + do + oid=$(git rev-parse "$ref") && + printf '%s\t%s\n' "$oid" "$ref" || return 1 + done +} + test_expect_success setup ' >file && git add file && @@ -43,34 +51,31 @@ test_expect_success 'ls-remote self' ' ' test_expect_success 'ls-remote --sort="version:refname" --tags self' ' - cat >expect <<-EOF && - $(git rev-parse mark) refs/tags/mark - $(git rev-parse mark1.1) refs/tags/mark1.1 - $(git rev-parse mark1.2) refs/tags/mark1.2 - $(git rev-parse mark1.10) refs/tags/mark1.10 - EOF + generate_references \ + refs/tags/mark \ + refs/tags/mark1.1 \ + refs/tags/mark1.2 \ + refs/tags/mark1.10 >expect && git ls-remote --sort="version:refname" --tags self >actual && test_cmp expect actual ' test_expect_success 'ls-remote --sort="-version:refname" --tags self' ' - cat >expect <<-EOF && - $(git rev-parse mark1.10) refs/tags/mark1.10 - $(git rev-parse mark1.2) refs/tags/mark1.2 - $(git rev-parse mark1.1) refs/tags/mark1.1 - $(git rev-parse mark) refs/tags/mark - EOF + generate_references \ + refs/tags/mark1.10 \ + refs/tags/mark1.2 \ + refs/tags/mark1.1 \ + refs/tags/mark >expect && git ls-remote --sort="-version:refname" --tags self >actual && test_cmp expect actual ' test_expect_success 'ls-remote --sort="-refname" --tags self' ' - cat >expect <<-EOF && - $(git rev-parse mark1.2) refs/tags/mark1.2 - $(git rev-parse mark1.10) refs/tags/mark1.10 - $(git rev-parse mark1.1) refs/tags/mark1.1 - $(git rev-parse mark) refs/tags/mark - EOF + generate_references \ + refs/tags/mark1.2 \ + refs/tags/mark1.10 \ + refs/tags/mark1.1 \ + refs/tags/mark >expect && git ls-remote --sort="-refname" --tags self >actual && test_cmp expect actual ' @@ -212,17 +217,18 @@ test_expect_success 'protocol v2 supports hiderefs' ' test_expect_success 'ls-remote --symref' ' git fetch origin && - cat >expect <<-EOF && - ref: refs/heads/master HEAD - $(git rev-parse HEAD) HEAD - $(git rev-parse refs/heads/master) refs/heads/master - $(git rev-parse HEAD) refs/remotes/origin/HEAD - $(git rev-parse refs/remotes/origin/master) refs/remotes/origin/master - $(git rev-parse refs/tags/mark) refs/tags/mark - $(git rev-parse refs/tags/mark1.1) refs/tags/mark1.1 - $(git rev-parse refs/tags/mark1.10) refs/tags/mark1.10 - $(git rev-parse refs/tags/mark1.2) refs/tags/mark1.2 - EOF + echo "ref: refs/heads/master HEAD" >expect && + generate_references \ + HEAD \ + refs/heads/master >>expect && + oid=$(git rev-parse HEAD) && + echo "$oid refs/remotes/origin/HEAD" >>expect && + generate_references \ + refs/remotes/origin/master \ + refs/tags/mark \ + refs/tags/mark1.1 \ + refs/tags/mark1.10 \ + refs/tags/mark1.2 >>expect && # Protocol v2 supports sending symrefs for refs other than HEAD, so use # protocol v0 here. GIT_TEST_PROTOCOL_VERSION=0 git ls-remote --symref >actual && From patchwork Thu Mar 26 08:27:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11459599 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 8072917EA for ; Thu, 26 Mar 2020 08:28:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6254420772 for ; Thu, 26 Mar 2020 08:28:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NcDixF0P" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727722AbgCZI2U (ORCPT ); Thu, 26 Mar 2020 04:28:20 -0400 Received: from mail-qk1-f195.google.com ([209.85.222.195]:40206 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727682AbgCZI2U (ORCPT ); Thu, 26 Mar 2020 04:28:20 -0400 Received: by mail-qk1-f195.google.com with SMTP id l25so5548398qki.7 for ; Thu, 26 Mar 2020 01:28:18 -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=/AsdvesCcNuKy+GJVPCFBByvyQ5W6NdG+7vAcWePzVc=; b=NcDixF0PJFwWJHYi9gyZObWxa0Gj1HCn0jPxUzTVvQG9vuRa21T320LnKaUBo+MJgF oENtUXntvlydL/dKWR17UBomFxQSeKBiQsnD/E0kCSWTB9bvE8w9aWCRX0ijh0j5VeqE l/8ni5OcQ/bfMgXU2Ii9ljk/F/RX09vvhzprN0uQcfErvc3LtetPTKJ3odblkmhYS5v8 c7y9lFvFZlsywtUgVkz1sc2AkQlqq+agxzin94tBRtEkmBB9hajMUj9IXEnfQ2izAtlP yKx3FYg9McIr561jgnqeDnK759pZXRbt9yi9k6RhmIAY12HNMDFGzRLiL6gyT/l3oGFD Q3PQ== 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=/AsdvesCcNuKy+GJVPCFBByvyQ5W6NdG+7vAcWePzVc=; b=fhPeEDo9KNGn4ABanspG6meqdYiKj4dmB1lHYOSmkrd6N3WKePDR+CVgMPry/YDwqF H0af4SRyq52QqMkyR4zk3DF2I8fSLcy1MAKXpj7OFO8TJdNUZ1nKqIbC6RlpMTmLrCS4 //IBDtVQUqvWzcFLLzNm/FsHcE8oLJEnVvPw893hLL16Dl+m38KDR0mIMlHsY5s85UOJ XIOraJU4grk0PdwuWP5ixmtmAnMwnfuoPpUZKoW4t8MRP1yBX2IymUIIYKV5USmFK4cY 2M1JfWV+Q/Jxz3c3L2ZFnR2rDON2OlJqR6r/MdaGc7nioep5FNFJvVwtpmZqVRZq6AI6 e7LA== X-Gm-Message-State: ANhLgQ0+MkD04OpYOsP6klMTfdrGPW2qp+NsNQ4WhA1xIPzfBBaVOpcI 4RrJijaRovRvxXM8I0juSeJTYyYE X-Google-Smtp-Source: ADFU+vsNiTvKWCheannuaS0N696N+y2krwxsYCE5Uf8DOS4XaoVQFq1zYSL5tfM+kLv+m6/ffWWELg== X-Received: by 2002:a37:496:: with SMTP id 144mr6753888qke.403.1585211297901; Thu, 26 Mar 2020 01:28:17 -0700 (PDT) Received: from archbookpro.lan ([199.249.110.29]) by smtp.gmail.com with ESMTPSA id g187sm935789qkf.115.2020.03.26.01.28.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 01:28:17 -0700 (PDT) From: Denton Liu To: Git Mailing List Subject: [PATCH v2 3/8] t5512: stop losing return codes of git commands Date: Thu, 26 Mar 2020 04:27:50 -0400 Message-Id: <986ba1dd3921251a03c1c4cf92e7439e012b07ed.1585209554.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 In a pipe, only the return code of the last command is used. Thus, all other commands will have their return codes masked. Rewrite pipes so that there are no git commands upstream so that their failure is reported. Signed-off-by: Denton Liu --- t/t5512-ls-remote.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/t/t5512-ls-remote.sh b/t/t5512-ls-remote.sh index dcb7349b0b..8928d1f62d 100755 --- a/t/t5512-ls-remote.sh +++ b/t/t5512-ls-remote.sh @@ -21,11 +21,11 @@ test_expect_success setup ' git tag mark1.1 && git tag mark1.2 && git tag mark1.10 && - git show-ref --tags -d | sed -e "s/ / /" >expected.tag && - ( - echo "$(git rev-parse HEAD) HEAD" && - git show-ref -d | sed -e "s/ / /" - ) >expected.all && + git show-ref --tags -d >expected.tag.raw && + sed -e "s/ / /" expected.tag.raw >expected.tag && + generate_references HEAD >expected.all && + git show-ref -d >refs && + sed -e "s/ / /" refs >>expected.all && git remote add self "$(pwd)/.git" ' @@ -185,8 +185,8 @@ do test_config $configsection.hiderefs refs/tags && git ls-remote . >actual && test_unconfig $configsection.hiderefs && - git ls-remote . | - sed -e "/ refs\/tags\//d" >expect && + git ls-remote . >expect.raw && + sed -e "/ refs\/tags\//d" expect.raw >expect && test_cmp expect actual ' From patchwork Thu Mar 26 08:27:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11459601 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 E64F61668 for ; Thu, 26 Mar 2020 08:28:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C60CE20772 for ; Thu, 26 Mar 2020 08:28:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="JJxwVPPN" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727742AbgCZI2d (ORCPT ); Thu, 26 Mar 2020 04:28:33 -0400 Received: from mail-qk1-f171.google.com ([209.85.222.171]:36044 "EHLO mail-qk1-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727724AbgCZI2c (ORCPT ); Thu, 26 Mar 2020 04:28:32 -0400 Received: by mail-qk1-f171.google.com with SMTP id d11so5562879qko.3 for ; Thu, 26 Mar 2020 01:28:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OTWRnwXLFVks91UVpL0hL4J0nNSz2tGoRrQxSVfMyCA=; b=JJxwVPPNgcq3t0gzoz3nlCfVmTszgVx7O1Wdmp7XNPEG7aS2328nyjSEyeV9kKI3aj 5ZgYRlMVHFXp6R9uDz3Jm3e913MH3s+TV40DeREXaslDj+IVn5BHykk+qvuLibLcnYO2 mI3aPvijlhmTJGX/5hgVmpKJu1TzaZhEdH1FP1C4WJrcozZAeuBGzoQ4ZtdFHZKubk/l P2a4pPSrzLBENW/oTQpft+SPZuUVzkA9Jqw5io+JGmPAFTUGHa+LMRXkpF4e+gJair9O 8ZPxUOlwmBAzYsFEYm7Tqt+TAgbFhyj7YhTMhyXIZ95MNa1qiLP2P4VTuc98YVT7Mnhp vyPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OTWRnwXLFVks91UVpL0hL4J0nNSz2tGoRrQxSVfMyCA=; b=SJVKRoq7Zb2nj5M0RvLVzr7L9OFYP3jWHEvG1W+9pyX/KcXagoYOqSNVRiwSvfTKN3 NBQqkknOXuomChskRRqFBgx4Mj1BiQuE8C3XNWt15rmB2IEKvpIehAZX0PIO5oxHWBTx T/hMLW5tCy5T9NiOHAWj8UsH4rkv52i38ppK+rRte72hhvarv/TvXXyQQKML3nOFpWdV EthRnd11Fp1eeG+GDK4qnXl2Z8ajFZ0qPuentRPtfSZI2zyfmS9djAboEOtC2382UsN5 bGJxceWajx57MCPfIHpppJl2C8HOeEucWhC0+RBv1ObotFzh1k9aEVcsw+6VfUO5euoG Jpuw== X-Gm-Message-State: ANhLgQ1xIZqybL6zVsasiV7RegVOmD/VVJ/MqR/OVhi7K+GBrn9WlwSH TWz+xVJMwARyObsAQBUPIOXEeLN6 X-Google-Smtp-Source: ADFU+vsgEZIRvhLy7wgeabZ6LaNB2nbPi3/BamF4K6/d6zygWdNcb7fus8StrukimSzFekQoVf6yog== X-Received: by 2002:a37:b002:: with SMTP id z2mr6707587qke.289.1585211310161; Thu, 26 Mar 2020 01:28:30 -0700 (PDT) Received: from archbookpro.lan ([199.249.110.29]) by smtp.gmail.com with ESMTPSA id g187sm935789qkf.115.2020.03.26.01.28.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 01:28:29 -0700 (PDT) From: Denton Liu To: Git Mailing List Cc: Junio C Hamano Subject: [PATCH v2 4/8] t5550: simplify no matching line check Date: Thu, 26 Mar 2020 04:27:51 -0400 Message-Id: <53e64e7077063a177cfafd97aa01340ee5b4cf1f.1585209554.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 In the 'did not use upload-pack service' test, we have a complicated song-and-dance to ensure that there are no "/git-upload-pack" lines in "$HTTPD_ROOT_PATH/access.log". Simplify this by just checking that grep returns a non-zero exit code. Helped-by: Junio C Hamano Signed-off-by: Denton Liu --- t/t5550-http-fetch-dumb.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/t/t5550-http-fetch-dumb.sh b/t/t5550-http-fetch-dumb.sh index b811d89cfd..bcde886b87 100755 --- a/t/t5550-http-fetch-dumb.sh +++ b/t/t5550-http-fetch-dumb.sh @@ -248,9 +248,7 @@ test_expect_success 'fetch can handle previously-fetched .idx files' ' ' test_expect_success 'did not use upload-pack service' ' - test_might_fail grep '/git-upload-pack' <"$HTTPD_ROOT_PATH"/access.log >act && - : >exp && - test_cmp exp act + ! grep "/git-upload-pack" "$HTTPD_ROOT_PATH/access.log" ' test_expect_success 'git client shows text/plain errors' ' From patchwork Thu Mar 26 08:27:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11459603 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 DF5CE1668 for ; Thu, 26 Mar 2020 08:28:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C0B3A2078E for ; Thu, 26 Mar 2020 08:28:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Qch2kaPr" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727738AbgCZI2d (ORCPT ); Thu, 26 Mar 2020 04:28:33 -0400 Received: from mail-qv1-f66.google.com ([209.85.219.66]:35860 "EHLO mail-qv1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727682AbgCZI2c (ORCPT ); Thu, 26 Mar 2020 04:28:32 -0400 Received: by mail-qv1-f66.google.com with SMTP id z13so2495040qvw.3 for ; Thu, 26 Mar 2020 01:28:31 -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=sBVr0xFCoRHeS2xGCDPImGVaY6u3pSWB1zUmqkoPxT8=; b=Qch2kaPrmZaiI89sONrx8VG/o83WtNMel+c33HQiOJbpQZM+LeUu5ae0sz02A+Ijll UVrMfQxsDE4f5qZVA7K5FcS4ixQdYXMnsIlBmqMw2V96pdXI3kaiV14aPSYBYxTmwcIO KfAEuQXkleWMKpDM/bv1a5plqgtjLzBUG1op/ivuMSXvYcg4LvH7ZKK0MCZaAHKUZZpE HExPr030pw8W2ygH9ns2lCKrfpq/uOUe1ZnQ4FsPbs3dB65x1p4jRzFgGtSXbETL+8ab gFq0c1h2gperC+z6UvK6iBSf+Lervke1u/ew95F1PWxMBkGha5GUh8zgr244G/IlAKij PsQw== 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=sBVr0xFCoRHeS2xGCDPImGVaY6u3pSWB1zUmqkoPxT8=; b=im1fb38V6LORECeFuiwbwimQZ+jauqPsLmOYbX8r90M3CnfZaTnGByaA1NelfwgyvC 94jGTB/MpaJtGu/PNmYCkbOl8wUau09tbYndjhMv5Cg2YbDJwFnuCWtPQ0rxDIDiQIG7 dx7huh7JOV0kPaZ3Mgud2JkcfFjjMDpWxna6F//7SYnGVMW2EBCwwKEYUM+q3xwUYBrw BB6hDWcTQGM93mPgiL1wMIq8qAJVNDJqt/qBEuskLswd6xex9ZaYZerzU8vKJxG2X+Mt UOl2x3ENPSgJhH2XkjOhr0/nQiLSj+9aAzfxEIiqjFRNJkvp/4DR7mK7nD34GOcmoB+y ZO8Q== X-Gm-Message-State: ANhLgQ2ejTE38siKaqLPahiMzeI97xLVVN74GOvzq57WMyBq+JcDr8hr vxzcNv6PbR3CxfneoGV6VjnuXRmL X-Google-Smtp-Source: ADFU+vudDsRXacsb5UHU+7DRX9162/HEh+raLzqfJIwMFhdSc6F59zXRwR6f1STY00TGqmE1XI+1HQ== X-Received: by 2002:ad4:5648:: with SMTP id bl8mr6829840qvb.189.1585211311114; Thu, 26 Mar 2020 01:28:31 -0700 (PDT) Received: from archbookpro.lan ([199.249.110.29]) by smtp.gmail.com with ESMTPSA id g187sm935789qkf.115.2020.03.26.01.28.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 01:28:30 -0700 (PDT) From: Denton Liu To: Git Mailing List Subject: [PATCH v2 5/8] t5607: reorder `nongit test_must_fail` Date: Thu, 26 Mar 2020 04:27:52 -0400 Message-Id: <4955b701e1f961e592e1c0c6567e28cbc12b3c14.1585209554.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 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/t5607-clone-bundle.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t5607-clone-bundle.sh b/t/t5607-clone-bundle.sh index 9108ff6fbd..6d5a977fcb 100755 --- a/t/t5607-clone-bundle.sh +++ b/t/t5607-clone-bundle.sh @@ -16,7 +16,7 @@ test_expect_success 'setup' ' test_expect_success '"verify" needs a worktree' ' git bundle create tip.bundle -1 master && - test_must_fail nongit git bundle verify ../tip.bundle 2>err && + nongit test_must_fail git bundle verify ../tip.bundle 2>err && test_i18ngrep "need a repository" err ' From patchwork Thu Mar 26 08:27:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11459605 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 A10FD81 for ; Thu, 26 Mar 2020 08:28:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 813242078E for ; Thu, 26 Mar 2020 08:28:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="b5UPR+i/" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727750AbgCZI2e (ORCPT ); Thu, 26 Mar 2020 04:28:34 -0400 Received: from mail-qk1-f193.google.com ([209.85.222.193]:40223 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727729AbgCZI2d (ORCPT ); Thu, 26 Mar 2020 04:28:33 -0400 Received: by mail-qk1-f193.google.com with SMTP id l25so5548783qki.7 for ; Thu, 26 Mar 2020 01:28:32 -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=n58nEpda53AYxbJqjD32mYUrlmc9oQSXYYZj23APSiE=; b=b5UPR+i/I0ONRJe1Sbh7VWvjaXrbk6RiqS/Qn+4BDmnMxxg/AlmtbcNHJguhCs0vW0 RutGE+pGBH3QButw/aABfyYT8/rqy4kBKpeasbK9ZaFnoB6KCMy4/Ee9/03oa102eoxB FJRNmIYk7OrD8j+qbdnc0P8Mcj6+qUIBYZoXhSnLU+tW60iQ5+tl+1N3WepOeu/Zl6fG oAkdJwD+3Ju9U2SqZ4h6VFcO/h+VpHPwE/tCjoNIfrdiEXNO9jaxIbLKCuNjoVLeWtWi DzmRoSbLVKzTlnEwr3+9lpS9geOooMlgkJXEStoqOThhZCxDFWLSTNFG0IxEuabahQlj dDPg== 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=n58nEpda53AYxbJqjD32mYUrlmc9oQSXYYZj23APSiE=; b=Vp25BOitOMxdWbfR/i92DdtXTK0yWP9b1dVGZ0P5iVuN1mYC4KtJr1cbfPMekKOkts 18kXDSFsJmTkiqJyk5LRhsR30Rd1peT9m2OhmJTCLMhGddaLajCJ8FG4olG8nfJrGDi+ nFNDEiLdXQMiM7ciwvWQNY0RokQ+sV7SVoeWZcSFW1NKAhu8g5d50yWwH8wNic0to04+ yxx3gISCcScUAv/qS+rfHu84aY1EdmPxxBPG96mTqKh45TqZuIya6WLWOuCoE3Nb0Cun omQ3XEZeaVokGhuvnsb3VeNy7NPhVvkJLW7bEWSRxe6PmVCURpaq6nnCELWm2AdjEQc9 fx7Q== X-Gm-Message-State: ANhLgQ0ZYZJaS/+W+FDyL4iz2m9+gwZBhN6a+Yekk0K0/d7Uj3SfzCGh mjJz2q6fhIGV5Z8U2vg76ayRvLTY X-Google-Smtp-Source: ADFU+vvYgWIq3KLolbfgH5EkMk7bSrmMrfzjIa/W3tbcMOlDgT5ozdg1wHsB0VIqOrWqV6kyOVwZ6g== X-Received: by 2002:a05:620a:a55:: with SMTP id j21mr6256131qka.125.1585211312297; Thu, 26 Mar 2020 01:28:32 -0700 (PDT) Received: from archbookpro.lan ([199.249.110.29]) by smtp.gmail.com with ESMTPSA id g187sm935789qkf.115.2020.03.26.01.28.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 01:28:31 -0700 (PDT) From: Denton Liu To: Git Mailing List Subject: [PATCH v2 6/8] t5612: don't use `test_must_fail test_cmp` Date: Thu, 26 Mar 2020 04:27:53 -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. Since test_cmp() just wraps an external command, replace `test_must_fail test_cmp` with `! test_cmp`. Signed-off-by: Denton Liu --- t/t5612-clone-refspec.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t5612-clone-refspec.sh b/t/t5612-clone-refspec.sh index e36ac01661..28373e715a 100755 --- a/t/t5612-clone-refspec.sh +++ b/t/t5612-clone-refspec.sh @@ -87,7 +87,7 @@ test_expect_success 'by default no tags will be kept updated' ' git for-each-ref refs/tags >../actual ) && git for-each-ref refs/tags >expect && - test_must_fail test_cmp expect actual && + ! test_cmp expect actual && test_line_count = 2 actual ' From patchwork Thu Mar 26 08:27:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11459607 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 BC8DE1668 for ; Thu, 26 Mar 2020 08:28:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9EACB207FC for ; Thu, 26 Mar 2020 08:28:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bj6ZDB8L" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727771AbgCZI2g (ORCPT ); Thu, 26 Mar 2020 04:28:36 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:40228 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727751AbgCZI2g (ORCPT ); Thu, 26 Mar 2020 04:28:36 -0400 Received: by mail-qk1-f196.google.com with SMTP id l25so5548824qki.7 for ; Thu, 26 Mar 2020 01:28:34 -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=bzkaWAt8EfYKTgpQaYXO6UoJakK7hxGA4NEVWLmilGI=; b=bj6ZDB8LRITOhHZUBw9WQ1lwhfVEs213nkg7/cVmSKldYaNJ/U49s8hvpQzLicOO1T kVQskz84/92y9FEv89Hnb3jPjv7p5TYGQZUisyfgzd6SjxDxqnUDojDonj+MxqPJVPaj uSz+erAcjSo2tp9ecq9PwahO0ogiOlSXRVQ09CwFIzyD3VlNj0U9d2sLC6DElI489agV MKKUnK4G1bCIyKewzO1fotwdkLkwm2RN+R3tbErzbDv8Zf93FdUkxGufwutNuvszoEJT 2kFp7IVxowz7MnoQU1uIbMou9jAerz5zwk97FKkyExZ4KJj8HS8tzrF9C1QqrjJSTqeV wlzA== 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=bzkaWAt8EfYKTgpQaYXO6UoJakK7hxGA4NEVWLmilGI=; b=QssDkn32kqucYcXLFfKxH2QeWDeNn1rsW77WFd0RNffZb/mnI9QF+nysApgTlA+fUI NylrHm89ZeVZivPteSRt7atW2SNuPT06qnVA5kYUatHYF7L6jZEx7AHSuN5cfrQEEHW1 cwXCDJ3neZMl/fOHBNnZYDrUSSEE9sH01d0xcGEBqSRri0NZSSLK34ZpcUOcTOfYwJAT PDuBxs7VD2DHyjWIKs5+BO/t5x3/WpEEfJkhND6iZ7QJ3z895jGey6DahRoDjLa7bhtx DAruy8Babtn+zMdcnEHxZlMzHVK0JpEeiWUB8wTqSziLawvFTNPE8gF/pvh4TlzZ64jN /vWg== X-Gm-Message-State: ANhLgQ2FBkdE8skHLYfcZnuMBLf1sjFa/4uQfmvSNL1uRuySK/9pk5lc Hjx7IF4F21OX6H8t4Zn9O2Da4WIT X-Google-Smtp-Source: ADFU+vuzN2XV3ecaByLKFiEPTlYhyIgYpzcTz75FBsvcH6ptmRd5WF+kTI+xsUBTT4XX+QDpLAuvlw== X-Received: by 2002:a37:a807:: with SMTP id r7mr7167873qke.5.1585211313316; Thu, 26 Mar 2020 01:28:33 -0700 (PDT) Received: from archbookpro.lan ([199.249.110.29]) by smtp.gmail.com with ESMTPSA id g187sm935789qkf.115.2020.03.26.01.28.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 01:28:32 -0700 (PDT) From: Denton Liu To: Git Mailing List Subject: [PATCH v2 7/8] t5612: stop losing return codes of git commands Date: Thu, 26 Mar 2020 04:27:54 -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 In a pipe, only the return code of the last command is used. Thus, all other commands will have their return codes masked. Rewrite pipes so that there are no git commands upstream so that their failure is reported. Signed-off-by: Denton Liu --- t/t5612-clone-refspec.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/t/t5612-clone-refspec.sh b/t/t5612-clone-refspec.sh index 28373e715a..e3b436d8ae 100755 --- a/t/t5612-clone-refspec.sh +++ b/t/t5612-clone-refspec.sh @@ -71,9 +71,9 @@ test_expect_success 'by default all branches will be kept updated' ' ( cd dir_all && git fetch && - git for-each-ref refs/remotes/origin | + git for-each-ref refs/remotes/origin >refs && sed -e "/HEAD$/d" \ - -e "s|/remotes/origin/|/heads/|" >../actual + -e "s|/remotes/origin/|/heads/|" refs >../actual ) && # follow both master and side git for-each-ref refs/heads >expect && @@ -104,9 +104,9 @@ test_expect_success '--single-branch while HEAD pointing at master' ' ( cd dir_master && git fetch --force && - git for-each-ref refs/remotes/origin | + git for-each-ref refs/remotes/origin >refs && sed -e "/HEAD$/d" \ - -e "s|/remotes/origin/|/heads/|" >../actual + -e "s|/remotes/origin/|/heads/|" refs >../actual ) && # only follow master git for-each-ref refs/heads/master >expect && @@ -126,9 +126,9 @@ test_expect_success '--single-branch while HEAD pointing at master and --no-tags ( cd dir_master_no_tags && git fetch && - git for-each-ref refs/remotes/origin | + git for-each-ref refs/remotes/origin >refs && sed -e "/HEAD$/d" \ - -e "s|/remotes/origin/|/heads/|" >../actual + -e "s|/remotes/origin/|/heads/|" refs >../actual ) && # only follow master git for-each-ref refs/heads/master >expect && @@ -156,9 +156,9 @@ test_expect_success '--single-branch while HEAD pointing at side' ' ( cd dir_side && git fetch && - git for-each-ref refs/remotes/origin | + git for-each-ref refs/remotes/origin >refs && sed -e "/HEAD$/d" \ - -e "s|/remotes/origin/|/heads/|" >../actual + -e "s|/remotes/origin/|/heads/|" refs >../actual ) && # only follow side git for-each-ref refs/heads/side >expect && @@ -169,9 +169,9 @@ test_expect_success '--single-branch with explicit --branch side' ' ( cd dir_side2 && git fetch && - git for-each-ref refs/remotes/origin | + git for-each-ref refs/remotes/origin >refs && sed -e "/HEAD$/d" \ - -e "s|/remotes/origin/|/heads/|" >../actual + -e "s|/remotes/origin/|/heads/|" refs >../actual ) && # only follow side git for-each-ref refs/heads/side >expect && @@ -223,9 +223,9 @@ test_expect_success '--single-branch with detached' ' ( cd dir_detached && git fetch && - git for-each-ref refs/remotes/origin | + git for-each-ref refs/remotes/origin >refs && sed -e "/HEAD$/d" \ - -e "s|/remotes/origin/|/heads/|" >../actual + -e "s|/remotes/origin/|/heads/|" refs >../actual ) && # nothing test_must_be_empty actual From patchwork Thu Mar 26 08:27:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11459609 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 3E59B17EA for ; Thu, 26 Mar 2020 08:28:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2006C207FC for ; Thu, 26 Mar 2020 08:28:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="AryNEg3I" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727769AbgCZI2g (ORCPT ); Thu, 26 Mar 2020 04:28:36 -0400 Received: from mail-qk1-f195.google.com ([209.85.222.195]:47085 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727729AbgCZI2f (ORCPT ); Thu, 26 Mar 2020 04:28:35 -0400 Received: by mail-qk1-f195.google.com with SMTP id u4so5503774qkj.13 for ; Thu, 26 Mar 2020 01:28:34 -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=B5o02/rQfQnbpSb7SQlxFYVvIOSMk/M9YYa7iJaCwVA=; b=AryNEg3Il8kGHtuLxXUsBz5BoVhmaxsvrdh1EG4Gxb66qopLP78lHHLqrtUaS81Afg H0dC0wjh19kbSg1QXoi5bLZ/AJmsTT+/mx6UKOqU56asr+q9HPGZ6tY7N/jQt0X/zj5f A1yULU3eQ8wiX98aTeK13Lm0Bjx1EEL2UvqXRAyctDoOzfbjl0/rpCiy5fe7AZ/BJTrC aKGxsxx/18mOTv9ATYHAON49rqVe9ELhsxa1qlWq8hmiR2Gh8Qhvk3KvNYrsbX4Hdeyo xCF2mEvNRbCXbM9sc6K5SMcvWHtIrKYl9SP030CA01gBez/clsV6SzP7WVw6iCUjNb22 1cfA== 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=B5o02/rQfQnbpSb7SQlxFYVvIOSMk/M9YYa7iJaCwVA=; b=hzZsNC3k65Q4Gg+vtZiYn8aM6YDBsJr+aorXeIT/3msbnmkVbG61mcGMlgW2C8yX13 Ej8Tw9lzqquOFqbj/gWlFBRpaLKG15idrXT39Xd66Vimrla/3pozmxrfiD1x7EOBoboa HreT3G4WPFpoJUZa1+fFIImiSCF37rULeJzBr5BFgcWP4SAuEqS5PSF4E1O7GPoQZ913 he+UCotMYYJF8pG7WNyZgpym29KjsKcvYPuaRJA7kl7w0S6PPvD0icoAf3q9W4HZo7EI D4ySItUt4Xv3dnckMArEcFqs84wmn5BcSv/UK3yfwWmCWFT15FFSjNvucxKWXaX36VZ3 jGSg== X-Gm-Message-State: ANhLgQ3/0O14JqaC3KgAbyPyTRrWmm69+WiaL0MB7ZdLAY4O1MuamTLo vzGQgXEBFVQTj4wkfyr0QYkvJrjM X-Google-Smtp-Source: ADFU+vt4bjwvpwB5xG/3hczVLWAdLTrCp+cWz0pOZvzVL5k6pftCFSIiLbRoR5d7VQKTdWR6aoqovg== X-Received: by 2002:a37:9b51:: with SMTP id d78mr7060796qke.65.1585211314229; Thu, 26 Mar 2020 01:28:34 -0700 (PDT) Received: from archbookpro.lan ([199.249.110.29]) by smtp.gmail.com with ESMTPSA id g187sm935789qkf.115.2020.03.26.01.28.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 01:28:33 -0700 (PDT) From: Denton Liu To: Git Mailing List Subject: [PATCH v2 8/8] t5801: teach compare_refs() to accept ! Date: Thu, 26 Mar 2020 04:27:55 -0400 Message-Id: <6a9d3cef2a0daf1b058921bd0cd3397f7753e537.1585209554.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 Before, testing if two refs weren't equal with compare_refs() was done with `test_must_fail compare_refs`. This was wrong for two reasons. First, test_must_fail should only be used on git commands. Second, negating the error code is a little heavy-handed since in the case where one of the git invocations within compare_refs() fails, we will report success, even though it failed at an unexpected point. Teach compare_refs() to accept `!` as the first argument which would _only_ negate the test_cmp()'s return code. Signed-off-by: Denton Liu --- t/t5801-remote-helpers.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/t/t5801-remote-helpers.sh b/t/t5801-remote-helpers.sh index 121e5c6edb..0f04b6cddb 100755 --- a/t/t5801-remote-helpers.sh +++ b/t/t5801-remote-helpers.sh @@ -11,9 +11,15 @@ test_description='Test remote-helper import and export commands' PATH="$TEST_DIRECTORY/t5801:$PATH" compare_refs() { + fail= && + if test "x$1" = 'x!' + then + fail='!' && + shift + fi && git --git-dir="$1/.git" rev-parse --verify $2 >expect && git --git-dir="$3/.git" rev-parse --verify $4 >actual && - test_cmp expect actual + eval $fail test_cmp expect actual } test_expect_success 'setup repository' ' @@ -189,7 +195,7 @@ test_expect_success GPG 'push signed tag' ' git push origin signed-tag ) && compare_refs local signed-tag^{} server signed-tag^{} && - test_must_fail compare_refs local signed-tag server signed-tag + compare_refs ! local signed-tag server signed-tag ' test_expect_success GPG 'push signed tag with signed-tags capability' ' From patchwork Fri Mar 27 00:43: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: 11461471 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 E3EED81 for ; Fri, 27 Mar 2020 00:44:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A8D5620719 for ; Fri, 27 Mar 2020 00:44:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="A0jepVW6" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727456AbgC0AoD (ORCPT ); Thu, 26 Mar 2020 20:44:03 -0400 Received: from mail-qt1-f193.google.com ([209.85.160.193]:35414 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726363AbgC0AoD (ORCPT ); Thu, 26 Mar 2020 20:44:03 -0400 Received: by mail-qt1-f193.google.com with SMTP id e14so7308918qts.2 for ; Thu, 26 Mar 2020 17:44:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ibNOJpUhlTg2jT33AmcMJgUohLdCQoA58aRpHOquG1Y=; b=A0jepVW6VwOIYWfuWtIpmfx+UU7f2GeJzXLvE6OXg2B58WSs27B3oueFjUSAn+RuBK 8qt1H7fKdVZ3Uh4AsksKOPCSYDgTLy3BKr7gVbTuzf5FdUAJtiDxVQFoSL/XuKvMts9l ZUL+vg+Q61vy764fb0K5B3xPxw7nq4X4usUsoA3mvFWppUsH0No6/CAU9CtzPWasMA40 awZ/N2o80pOxLDIPM/24afE5IMaXFaTxBgpmWUDYUzuR+k7HDd/vAcS6hqpkv924hENJ Dsov1vo05VWsjwjypyGBUIUAcQJbU1G9lnqytf1GmO6nhCAdALaKQjDbHoMDkzwZ03jn I4AQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ibNOJpUhlTg2jT33AmcMJgUohLdCQoA58aRpHOquG1Y=; b=AopTceYI1LLZZ4se0EBbb7WlRKlKKu3mqGkJsKMj/A213JsRkGZSlHb3WhR/Sbdmzn pz9RL25wPy4xUB59JlJ9+NN4OdVZzIyTmn1f2xki/E/C/pXzWi1J7PM6c82o0Ph44YNX ci+vbwTyJFhrcUHqdnLimv7NFhnB1jTFS4zWSWIMmv/46ZArVVjXrREs9bNxt31PbWL6 NJSJCxg+t8mAlXdlITl4vQnlU1hrVjiX1AtIZ23+f5WhVpl8cbrwYcQESc6/b9gKEBfE 9WzEjOriYV6bZcLKPuZXG0p5Ufi1ztcZFNFMwLb+FPNevmJJ07UqQ8iwUj8OlhK90qNt qlIw== X-Gm-Message-State: ANhLgQ14VUg7Y9ZPLTKMSqMNctsr6AJry2BzL2uzj0RzzSYAg/xcZrR0 zNwXeUV5b/FYu63Dg1fMCfvXh42I X-Google-Smtp-Source: ADFU+vsnyEhl9QJov0mbcMva4lrydpdNqSJ26akbrJm9tzEzPfWbXZjr+mzEgSxmkZt/z/sV/Cv0uQ== X-Received: by 2002:aed:3e71:: with SMTP id m46mr1382352qtf.77.1585269840468; Thu, 26 Mar 2020 17:44:00 -0700 (PDT) Received: from localhost.localdomain (ktnron0919w-grc-01-76-68-141-233.dsl.bell.ca. [76.68.141.233]) by smtp.gmail.com with ESMTPSA id x127sm2578542qke.135.2020.03.26.17.43.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 17:43:59 -0700 (PDT) From: Denton Liu To: Git Mailing List Cc: Eric Sunshine , Junio C Hamano Subject: [PATCH v2 9/9] fixup! t5512: stop losing git exit code in here-docs Date: Thu, 26 Mar 2020 20:43:45 -0400 Message-Id: <38924d9c4994b5bad93cbbd2659666f6b452a89f.1585269773.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 Signed-off-by: Denton Liu --- t/t5512-ls-remote.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t5512-ls-remote.sh b/t/t5512-ls-remote.sh index 8928d1f62d..e98c3a0174 100755 --- a/t/t5512-ls-remote.sh +++ b/t/t5512-ls-remote.sh @@ -224,7 +224,7 @@ test_expect_success 'ls-remote --symref' ' oid=$(git rev-parse HEAD) && echo "$oid refs/remotes/origin/HEAD" >>expect && generate_references \ - refs/remotes/origin/master \ + refs/remotes/origin/master \ refs/tags/mark \ refs/tags/mark1.1 \ refs/tags/mark1.10 \