]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t7003: compute appropriate length constant
authorbrian m. carlson <sandals@crustytoothpaste.net>
Wed, 29 Jul 2020 23:13:59 +0000 (23:13 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 30 Jul 2020 16:16:46 +0000 (09:16 -0700)
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>
t/t7003-filter-branch.sh

index e23de7d0b5a4da29effb1e59426f857fed0e91e0..36477cb1f4470055726cc89d1e69af5f60d88bd2 100755 (executable)
@@ -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)
 '