Skip to content

Commit

Permalink
t1050: match object ID paths in a hash-insensitive way
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
bk2204 authored and gitster committed May 13, 2020
1 parent b994622 commit a114296
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion t/t1050-large.sh
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions t/test-lib.sh
Expand Up @@ -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
Expand Down

0 comments on commit a114296

Please sign in to comment.