1
0
mirror of https://github.com/git/git.git synced 2024-09-28 11:11:18 +02:00

t7003: compute appropriate length constant

Instead of using a specific invalid hard-coded object ID, look one
up from the translation table.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Reviewed-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
brian m. carlson 2020-07-29 23:13:59 +00:00 committed by Junio C Hamano
parent 252a4ee66a
commit 4bacb6d50e

View File

@ -463,10 +463,11 @@ test_expect_success 'rewrite submodule with another content' '
'
test_expect_success 'replace submodule revision' '
invalid=$(test_oid numeric) &&
git reset --hard original &&
git filter-branch -f --tree-filter \
"if git ls-files --error-unmatch -- submod > /dev/null 2>&1
then git update-index --cacheinfo 160000 0123456789012345678901234567890123456789 submod
then git update-index --cacheinfo 160000 $invalid submod
fi" HEAD &&
test $orig_head != $(git show-ref --hash --head HEAD)
'