From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id B98C81F5AE for ; Wed, 29 Jul 2020 23:15:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728096AbgG2XPD (ORCPT ); Wed, 29 Jul 2020 19:15:03 -0400 Received: from injection.crustytoothpaste.net ([192.241.140.119]:41044 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728091AbgG2XPA (ORCPT ); Wed, 29 Jul 2020 19:15:00 -0400 Received: from camp.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:b610:a2f0:36c1:12e3]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id 269C66101C; Wed, 29 Jul 2020 23:14:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1596064497; bh=e0GG4MGDDPBIn8sVOpdBt+JTBrciFKCG4qAUcFp9kSg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Reply-To: Subject:Date:To:CC:Resent-Date:Resent-From:Resent-To:Resent-Cc: In-Reply-To:References:Content-Type:Content-Disposition; b=MFr75La0cPEX7m5heOa07K9g9txzdnpYlcSW0TVNI7sa9fq1NpFdhu3W5OcLZD51m +udQLfsncmJtWdT9HeWEDqcCXG0lHoj+SyDlMCVqYhsIty4G6pcJuE2EJda9DVHCLy g37QRDiacP4XllmRerbtNdeLSltMmUETeGBEDXXfbkqc6AGOAAeQyFv8AVzrodMg4l 9iA/7eTVUjHS1SaXpOHDRwFVazBds7GHGaRoPrkUTiMYyHneRiRYFlA4XNNXg56uhL Pa74Ip/y2V+QRO34Pa2hMtN05jBN6lLADoee7kQKXs8xQy9p62y+id28Vcph+HONQZ CUF6GrXSafGmM0OBwrCjRl2gmhPz9VLUCA6bINC2U2fa1rQU/XeoSq+whhEvX/Ugoy 5hUws35tJUGIrSQSzLGxewxvnrLLVwvTnDt5eCDnqS/91JSSx67f3a+C5/bYhY4vl5 DI1iRtaf8Ft5k9PMTRZlDrcF0Me5idEC3idqiBz42MQlX5b9+Sf From: "brian m. carlson" To: Cc: Eric Sunshine Subject: [PATCH v6 25/39] t9500: ensure that algorithm info is preserved in config Date: Wed, 29 Jul 2020 23:14:14 +0000 Message-Id: <20200729231428.3658647-26-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.28.0.163.g6104cc2f0b6 In-Reply-To: <20200729231428.3658647-1-sandals@crustytoothpaste.net> References: <20200728233446.3066485-1-sandals@crustytoothpaste.net> <20200729231428.3658647-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org When we use a hash algorithm other than SHA-1, it's important to preserve the hash-related values in the config file, but this test overwrites the config file with a new one. Ensure we copy these values properly from the old config to the new one so that the repository can be read if it's using SHA-256. Note that if there is no extensions.objectFormat value set, git config will return unsuccessfully if we try to read it; since this is not an error for us, use test_might_fail. Signed-off-by: brian m. carlson --- t/t9500-gitweb-standalone-no-errors.sh | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh index 267ddc997d..b484e3e250 100755 --- a/t/t9500-gitweb-standalone-no-errors.sh +++ b/t/t9500-gitweb-standalone-no-errors.sh @@ -621,12 +621,22 @@ test_expect_success \ git config gitweb.snapshot "zip,tgz, tbz2" && gitweb_run "p=.git;a=tree"' -cat >.git/config <<\EOF -# testing noval and alternate separator -[gitweb] - blame - snapshot = zip tgz -EOF +test_expect_success 'setup' ' + version=$(git config core.repositoryformatversion) && + algo=$(test_might_fail git config extensions.objectformat) && + cat >.git/config <<-\EOF && + # testing noval and alternate separator + [gitweb] + blame + snapshot = zip tgz + EOF + git config core.repositoryformatversion "$version" && + if test -n "$algo" + then + git config extensions.objectformat "$algo" + fi +' + test_expect_success \ 'config override: tree view, features enabled in repo config (2)' \ 'gitweb_run "p=.git;a=tree"'