t1050: match object ID paths in a hash-insensitive way

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 <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
brian m. carlson 2020-05-13 00:53:41 +00:00 committed by Junio C Hamano
parent b994622632
commit a114296371
2 changed files with 2 additions and 1 deletions

View file

@ -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

View file

@ -1428,6 +1428,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