]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t1050: match object ID paths in a hash-insensitive way
authorbrian m. carlson <sandals@crustytoothpaste.net>
Wed, 13 May 2020 00:53:41 +0000 (00:53 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 13 May 2020 05:36:17 +0000 (22:36 -0700)
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>
t/t1050-large.sh
t/test-lib.sh

index 184b479a2111a8d16c2aeb8a8bc681299b44725a..7f88ea07c27819bdabffcda4470f243c0343cd90 100755 (executable)
@@ -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
index baf94546da10b369ba1f96d5d40b8ae43dfafe57..77e9a60fcbc1237beca44c39ed5d045b116b0fd3 100644 (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