t6100: make hash size independent

Instead of hard-coding a constant 40, split the output of rev-list by
field.

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>
This commit is contained in:
brian m. carlson 2020-07-29 23:13:54 +00:00 committed by Junio C Hamano
parent 800e6a7041
commit 11b6961f8b

View File

@ -22,7 +22,7 @@ test_expect_success 'setup a commit history with trees, blobs' '
test_expect_success 'rev-list --in-commit-order' '
git rev-list --in-commit-order --objects HEAD >actual.raw &&
cut -c 1-40 >actual <actual.raw &&
cut -d" " -f1 >actual <actual.raw &&
git cat-file --batch-check="%(objectname)" >expect.raw <<-\EOF &&
HEAD^{commit}
@ -49,7 +49,7 @@ test_expect_success 'rev-list --in-commit-order' '
test_expect_success 'rev-list lists blobs and trees after commits' '
git rev-list --objects HEAD >actual.raw &&
cut -c 1-40 >actual <actual.raw &&
cut -d" " -f1 >actual <actual.raw &&
git cat-file --batch-check="%(objectname)" >expect.raw <<-\EOF &&
HEAD^{commit}