t6006: make hash size independent
Instead of hard-coding the length of an object ID when creating a tree, compute it for the hash in use using the translation tables. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
brian m. carlson committed
Feb 7, 2020 at 00:52 UTC
edf04243b2b805c4730c531745e8a5b317cd0a90
1 file changed
+3
-1
t/t6006-rev-list-format.sh
+3
-1
@@ -32,6 +32,7 @@ changed_iso88591=$(echo "$changed" | iconv -f utf-8 -t $test_encoding)
32
truncate_count=20
33
34
test_expect_success 'setup' '
35
+ test_oid_init &&
36
: >foo &&
37
git add foo &&
38
git config i18n.commitEncoding $test_encoding &&
@@ -463,9 +464,10 @@ test_expect_success '--abbrev' '
464
'
465
466
test_expect_success '%H is not affected by --abbrev-commit' '
467
+ expected=$(($(test_oid hexsz) + 1)) &&
468
git log -1 --format=%H --abbrev-commit --abbrev=20 HEAD >actual &&
469
len=$(wc -c <actual) &&
468
- test $len = 41
470
+ test $len = $expected
471
'
472
473
test_expect_success '%h is not affected by --abbrev-commit' '