Skip to content

Commit edf0424

Browse files
bk2204gitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5db24dc commit edf0424

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

t/t6006-rev-list-format.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ changed_iso88591=$(echo "$changed" | iconv -f utf-8 -t $test_encoding)
3232
truncate_count=20
3333

3434
test_expect_success 'setup' '
35+
test_oid_init &&
3536
: >foo &&
3637
git add foo &&
3738
git config i18n.commitEncoding $test_encoding &&
@@ -463,9 +464,10 @@ test_expect_success '--abbrev' '
463464
'
464465

465466
test_expect_success '%H is not affected by --abbrev-commit' '
467+
expected=$(($(test_oid hexsz) + 1)) &&
466468
git log -1 --format=%H --abbrev-commit --abbrev=20 HEAD >actual &&
467469
len=$(wc -c <actual) &&
468-
test $len = 41
470+
test $len = $expected
469471
'
470472

471473
test_expect_success '%h is not affected by --abbrev-commit' '

0 commit comments

Comments
 (0)