Browse Source

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>
maint
brian m. carlson 5 years ago committed by Junio C Hamano
parent
commit
a114296371
  1. 2
      t/t1050-large.sh
  2. 1
      t/test-lib.sh

2
t/t1050-large.sh

@ -64,7 +64,7 @@ test_expect_success 'add a large file or two' '
test $count = 1 && test $count = 1 &&
cnt=$(git show-index <"$idx" | wc -l) && cnt=$(git show-index <"$idx" | wc -l) &&
test $cnt = 2 && test $cnt = 2 &&
for l in .git/objects/??/?????????????????????????????????????? for l in .git/objects/$OIDPATH_REGEX
do do
test_path_is_file "$l" || continue test_path_is_file "$l" || continue
bad=t bad=t

1
t/test-lib.sh

@ -1428,6 +1428,7 @@ test_oid_init


ZERO_OID=$(test_oid zero) ZERO_OID=$(test_oid zero)
OID_REGEX=$(echo $ZERO_OID | sed -e 's/0/[0-9a-f]/g') 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_TREE=$(test_oid empty_tree)
EMPTY_BLOB=$(test_oid empty_blob) EMPTY_BLOB=$(test_oid empty_blob)
_z40=$ZERO_OID _z40=$ZERO_OID

Loading…
Cancel
Save