]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t6006-rev-list-format.sh
t6006: make hash size independent
[thirdparty/git.git] / t / t6006-rev-list-format.sh
index ebdc49c4965edecf1d32aba7a3a2346f770bad92..7e82e43a634a1fa0546b13769afe69d342c5fe62 100755 (executable)
@@ -32,6 +32,7 @@ changed_iso88591=$(echo "$changed" | iconv -f utf-8 -t $test_encoding)
 truncate_count=20
 
 test_expect_success 'setup' '
+       test_oid_init &&
        : >foo &&
        git add foo &&
        git config i18n.commitEncoding $test_encoding &&
@@ -463,9 +464,10 @@ test_expect_success '--abbrev' '
 '
 
 test_expect_success '%H is not affected by --abbrev-commit' '
+       expected=$(($(test_oid hexsz) + 1)) &&
        git log -1 --format=%H --abbrev-commit --abbrev=20 HEAD >actual &&
        len=$(wc -c <actual) &&
-       test $len = 41
+       test $len = $expected
 '
 
 test_expect_success '%h is not affected by --abbrev-commit' '