]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t6100: make hash size independent
authorbrian m. carlson <sandals@crustytoothpaste.net>
Wed, 29 Jul 2020 23:13:54 +0000 (23:13 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 30 Jul 2020 16:16:45 +0000 (09:16 -0700)
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>
t/t6100-rev-list-in-order.sh

index b2bb0a7f61814fc0f07899ef9c138374e7b81140..e934bc239c534d5da532c28d520732475859b665 100755 (executable)
@@ -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}