From patchwork Mon May 25 19:58:47 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: 11569329 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 14E0E739 for ; Mon, 25 May 2020 19:59:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F140220787 for ; Mon, 25 May 2020 19:59:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (3072-bit key) header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.b="vXQhq1on" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390387AbgEYT7q (ORCPT ); Mon, 25 May 2020 15:59:46 -0400 Received: from injection.crustytoothpaste.net ([192.241.140.119]:38678 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390354AbgEYT7o (ORCPT ); Mon, 25 May 2020 15:59:44 -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 419866081B; Mon, 25 May 2020 19:59:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1590436783; bh=hh0AAPebP5FiADzq2rtNsAQTbv06qUSl3vhXg+93iek=; 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=vXQhq1onyb6tdMWILgHHVIIa36sdR4Q8eLKdIZUPe/CTM3P2BwvwddvdWKnGr5+YX Px6ECsZ03mFQZ68gBHqXc2EBhi06PKhEKSMXXx0syvEGUmZ7ubjwARVfZ1PklO+eF2 +yGkLqSB3iNm/3tU7GCDhTihePfC7+HOFBm8+qQZXBkGBnX3514kOutnBi4QBioTjJ 7UBa+4tL1t5OWeORIxFUN3yygyk/YhJ6bHw1fvY8j/LJXMPYaN0J/URzCKPdh5vFzW //YHkcjgOP7e/l12mT5i2Bzf3VlobX1qE5cI3fvDIL0wHRKDStITMvNE9S6SOgCYHd Vdvcf6fOvb+cby/D/CyjBYF9Gesdk74it1s6mBRT23sFz/DghVQqgy/jaJasqTmKNL Q+J5CwJBGz+LyFzPSP45axvyTPiYDdajMKmPJ0Njccq5Bwa6wtPFzCvwVK9dbmRNNL ByXrsanhZzJvWJZKtZrBo9mJG2/Bx5MLqhGems0RyXrGkrcG/KU From: "brian m. carlson" To: Cc: =?utf-8?q?Martin_=C3=85gren?= Subject: [PATCH v2 01/44] t1050: match object ID paths in a hash-insensitive way Date: Mon, 25 May 2020 19:58:47 +0000 Message-Id: <20200525195930.309665-2-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.27.0.rc0.183.gde8f92d652 In-Reply-To: <20200525195930.309665-1-sandals@crustytoothpaste.net> References: <20200513005424.81369-1-sandals@crustytoothpaste.net> <20200525195930.309665-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 pattern here looking for failures is specific to SHA-1. Let's create a variable that matches the regex or glob pattern for a path within the objects directory. Signed-off-by: brian m. carlson --- t/t1050-large.sh | 2 +- t/test-lib.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/t/t1050-large.sh b/t/t1050-large.sh index 184b479a21..7f88ea07c2 100755 --- a/t/t1050-large.sh +++ b/t/t1050-large.sh @@ -64,7 +64,7 @@ test_expect_success 'add a large file or two' ' test $count = 1 && cnt=$(git show-index <"$idx" | wc -l) && test $cnt = 2 && - for l in .git/objects/??/?????????????????????????????????????? + for l in .git/objects/$OIDPATH_REGEX do test_path_is_file "$l" || continue bad=t diff --git a/t/test-lib.sh b/t/test-lib.sh index d36b6ddc62..5c65c3e26c 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -1414,6 +1414,7 @@ test_oid_init ZERO_OID=$(test_oid zero) OID_REGEX=$(echo $ZERO_OID | sed -e 's/0/[0-9a-f]/g') +OIDPATH_REGEX=$(test_oid_to_path $ZERO_OID | sed -e 's/0/[0-9a-f]/g') EMPTY_TREE=$(test_oid empty_tree) EMPTY_BLOB=$(test_oid empty_blob) _z40=$ZERO_OID