From patchwork Mon Jan 13 12:47:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "brian m. carlson" X-Patchwork-Id: 11330099 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 8FB9A13A0 for ; Mon, 13 Jan 2020 12:48:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 627CB214AF for ; Mon, 13 Jan 2020 12:48:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (3072-bit key) header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.b="DzxM5KiY" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728558AbgAMMsX (ORCPT ); Mon, 13 Jan 2020 07:48:23 -0500 Received: from injection.crustytoothpaste.net ([192.241.140.119]:37778 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726399AbgAMMsB (ORCPT ); Mon, 13 Jan 2020 07:48:01 -0500 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 C6F0760735 for ; Mon, 13 Jan 2020 12:48:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1578919681; bh=9EEePANQ2c24SEBMWwUKldhh+6sYn65TqetuuT6CHk0=; h=From:To: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=DzxM5KiYNFIV/2xmjp7Dx/QDjxbo04HJMMnuv/tm2IEh+ByLwhiBL3rVMuQuBigPd CzaOzxMb6Ge1UC0ZRnE4OEznSz2eSPhQDdJGOZLSsSYTR23u9DcmgPwM+vPbXkJnMh ADy8UlsCDZdhoEV4UGTU45BdyYDs01LNRsVJ6vK9zmsgARL+L/jTSNdXQDas08wwoh cQ8mr6ZWf2aUncmsrbD885vaeinL8NN27fiMViD31SGMkADTuRRZv1XALfsn+vHMQS Z7yvBoVv21JFkhcK0d0XYjOwl4Axn3Fz6DrEi0NTXJIc94cIdzzh1FGB1erxJ9juGY q+ZpOYzHv3KgTx6z7Uu80ReDMKMoBkn9tLMigfI2WFtf3QHXx6An0Eaik5oqNOCuyi 6SApKVbuuV0CURhUhXAVf7LWiLbR+uCniNYUp31WFuGwIXNsBZEkDMLcU2zkoCV3Mz +2IyYy9fXNgFvnC90TwWzx0/nadRZhVevmSZH5MFlmjAlCmND8Z From: "brian m. carlson" To: Subject: [RFC PATCH 08/22] t/helper: initialize repository if necessary Date: Mon, 13 Jan 2020 12:47:15 +0000 Message-Id: <20200113124729.3684846-9-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.25.0.rc2.338.g21a285fb81 In-Reply-To: <20200113124729.3684846-1-sandals@crustytoothpaste.net> References: <20200113124729.3684846-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org The repository helper is used in t5318 to read commit graphs whether we're in a repository or not. However, without a repository, we have no way to properly initialize the hash algorithm, meaning that the file is misread. Fix this by calling setup_git_directory_gently, which will read the environment variable the testsuite sets to ensure that the correct hash algorithm is set. Signed-off-by: brian m. carlson --- t/helper/test-repository.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/t/helper/test-repository.c b/t/helper/test-repository.c index f7f8618445..ecc768e4cb 100644 --- a/t/helper/test-repository.c +++ b/t/helper/test-repository.c @@ -75,6 +75,10 @@ static void test_get_commit_tree_in_graph(const char *gitdir, int cmd__repository(int argc, const char **argv) { + int nongit_ok = 0; + + setup_git_directory_gently(&nongit_ok); + if (argc < 2) die("must have at least 2 arguments"); if (!strcmp(argv[1], "parse_commit_in_graph")) {