Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2020-02-07 03:52:53 +0300
committerJunio C Hamano <gitster@pobox.com>2020-02-07 22:07:31 +0300
commitedf04243b2b805c4730c531745e8a5b317cd0a90 (patch)
tree4080faba5e3004af03f820bdb5a523187b289b80 /t/t6006-rev-list-format.sh
parent5db24dcffd8b6790ff4d9d73e13fa892ebc172a4 (diff)
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>
Diffstat (limited to 't/t6006-rev-list-format.sh')
-rwxr-xr-xt/t6006-rev-list-format.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/t/t6006-rev-list-format.sh b/t/t6006-rev-list-format.sh
index ebdc49c496..7e82e43a63 100755
--- a/t/t6006-rev-list-format.sh
+++ b/t/t6006-rev-list-format.sh
@@ -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' '