diff options
author | brian m. carlson <sandals@crustytoothpaste.net> | 2020-02-07 03:52:52 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-02-07 22:07:31 +0300 |
commit | 5db24dcffd8b6790ff4d9d73e13fa892ebc172a4 (patch) | |
tree | 54193bb6df879cc9d504ea97ad46e005be1dd290 /t/t6000-rev-list-misc.sh | |
parent | d341e0805d91b4575ed3426be8e8bcb44744846c (diff) |
t6000: abstract away SHA-1-specific constants
Adjust the test so that it computes variables for object IDs instead of
using hard-coded hashes.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t6000-rev-list-misc.sh')
-rwxr-xr-x | t/t6000-rev-list-misc.sh | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/t/t6000-rev-list-misc.sh b/t/t6000-rev-list-misc.sh index b8cf82349b..a0baf9ee43 100755 --- a/t/t6000-rev-list-misc.sh +++ b/t/t6000-rev-list-misc.sh @@ -104,13 +104,16 @@ test_expect_success 'rev-list can show index objects' ' # - we do not show the root tree; since we updated the index, it # does not have a valid cache tree # - cat >expect <<-\EOF && - 8e4020bb5a8d8c873b25de15933e75cc0fc275df one - d9d3a7417b9605cfd88ee6306b28dadc29e6ab08 only-in-index - 9200b628cf9dc883a85a7abc8d6e6730baee589c two - EOF echo only-in-index >only-in-index && test_when_finished "git reset --hard" && + rev1=$(git rev-parse HEAD:one) && + rev2=$(git rev-parse HEAD:two) && + revi=$(git hash-object only-in-index) && + cat >expect <<-EOF && + $rev1 one + $revi only-in-index + $rev2 two + EOF git add only-in-index && git rev-list --objects --indexed-objects >actual && test_cmp expect actual |