From patchwork Fri Apr 23 05:47:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 12219661 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC6E2C433B4 for ; Fri, 23 Apr 2021 05:47:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A41FE60BBB for ; Fri, 23 Apr 2021 05:47:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240329AbhDWFsC (ORCPT ); Fri, 23 Apr 2021 01:48:02 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:57717 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbhDWFsB (ORCPT ); Fri, 23 Apr 2021 01:48:01 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id DCB7D5C015C; Fri, 23 Apr 2021 01:47:24 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Fri, 23 Apr 2021 01:47:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=hmLArgP04ZSCTFrm4NV6gY+ojZ8 hg1UEQZLVuQ3i5eI=; b=toaxpDxHrCEmIUhPBNW/e5jNjM90y9kwWN7EkkQIPe3 3u7tZbUYhkqOvH5YXp0dAuqh+9XVnSs66KVSeH7omhSbr5jxd0Og27Wr7FZMih6r WJIwCcEKMsVfiVChXFsdD7c0gWD+Rr3mEBZQtD0gPpE9REI2OISA7uT1lJiQvWX3 SilyTsmjbNYyrl/SYEEwKIICM3iPjwwW3mZc8YhtNbpX3JAE3nsZnLHd1fAPsxbY bpn8G+b7lKPeWkg3N5y8Wlh3cnr83cBVftxXv+zTjGC4Rc473tPM2QxyraxNOJqB CfEJ7lxYCJH0fsysHoc2TPQXEnV3kqzPzX6X8aefLGw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=hmLArg P04ZSCTFrm4NV6gY+ojZ8hg1UEQZLVuQ3i5eI=; b=FZpSXgFoUdwobZcSjPab6F DSh/s1ge1lIlgrhzLB2sOtP7B003YSlhRfjsV2X76h/vt6y9MLqx/169/bHh7y5b PAgmpFScLMG7uLfQ3ioy7yN6yhN9U9Knn9b2padeS/bDTq6nmRaO5/P8FgxxGRaW MYMNIlHBmeSs8UyzSDsp0WvCCDqlBXU/VJ9i1n7rmhjxYxdeW6aAl1AbKyFxRwa4 BnqtyWHCIn1fbjJzysijjfOxtQiuDlvs8mG0NrPO1VES+aDYiHWaXLZOWlR2Qz0t URqWSFuw6vrs7Q7Ukxg+3mIypiPrO13pohHNeNmDbdSOhLEVNNVrXY5zuW+JPcTQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdduuddgleeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehgtderredttddunecuhfhrohhmpefrrghtrhhi tghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrihhmqeenucggtffrrghtthgvrh hnpedtffejieduudelhedvgfetieefleehjeetvdetudeitdetvddtfffffefhvdfggfen ucfkphepjeejrdduuddruddtgedrhedunecuvehluhhsthgvrhfuihiivgeptdenucfrrg hrrghmpehmrghilhhfrhhomhepphhssehpkhhsrdhimh X-ME-Proxy: Received: from vm-mail.pks.im (dynamic-077-011-104-051.77.11.pool.telefonica.de [77.11.104.51]) by mail.messagingengine.com (Postfix) with ESMTPA id 6EFC8108005B; Fri, 23 Apr 2021 01:47:23 -0400 (EDT) Received: from localhost (ncase [10.192.0.11]) by vm-mail.pks.im (OpenSMTPD) with ESMTPSA id d8d4dc93 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 23 Apr 2021 05:47:16 +0000 (UTC) Date: Fri, 23 Apr 2021 07:47:15 +0200 From: Patrick Steinhardt To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King , =?iso-8859-1?q?=C6var_Arnfj=F6r=F0?= Bjarmason , Eric Sunshine Subject: [PATCH] t1300: fix unset of GIT_CONFIG_NOSYSTEM leaking into subsequent tests Message-ID: <5b69d9d34e4bdf1c7eb3b172ad8ef0f78542c789.1619156659.git.ps@pks.im> References: <20210421204637.GA2947267@szeder.dev> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210421204637.GA2947267@szeder.dev> Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org In order to test whether the new GIT_CONFIG_SYSTEM environment variable behaves as expected, we unset GIT_CONFIG_NOSYSTEM in one of our tests in t1300. But because tests are not executed in a subshell, this unset leaks into all subsequent tests and may thus cause them to fail in some environments. These failures are easily reproducable with `make prefix=/root test`. Fix the issue by not using `sane_unset GIT_CONFIG_NOSYSTEM`, but instead just manually add it to the environment of the two command invocations which need it. Reported-by: SZEDER Gábor Signed-off-by: Patrick Steinhardt --- This patch applies on top of 47e6f16901 (Sync with master, 2021-04-20), which is the tip of next at the time of writing. t/t1300-config.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/t/t1300-config.sh b/t/t1300-config.sh index 0f92dfe6fb..ec599baeba 100755 --- a/t/t1300-config.sh +++ b/t/t1300-config.sh @@ -2092,21 +2092,20 @@ test_expect_success 'override global and system config' ' git config --show-scope --list >output && test_cmp expect output && - sane_unset GIT_CONFIG_NOSYSTEM && - cat >expect <<-EOF && system system.config=true global global.config=true local local.config=true EOF - GIT_CONFIG_SYSTEM=custom-system-config GIT_CONFIG_GLOBAL=custom-global-config \ + GIT_CONFIG_NOSYSTEM=false GIT_CONFIG_SYSTEM=custom-system-config GIT_CONFIG_GLOBAL=custom-global-config \ git config --show-scope --list >output && test_cmp expect output && cat >expect <<-EOF && local local.config=true EOF - GIT_CONFIG_SYSTEM=/dev/null GIT_CONFIG_GLOBAL=/dev/null git config --show-scope --list >output && + GIT_CONFIG_NOSYSTEM=false GIT_CONFIG_SYSTEM=/dev/null GIT_CONFIG_GLOBAL=/dev/null \ + git config --show-scope --list >output && test_cmp expect output '