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>
brian m. carlson committed
Feb 7, 2020 at 00:52 UTC
5db24dcffd8b6790ff4d9d73e13fa892ebc172a4
1 file changed
+8
-5
t/t6000-rev-list-misc.sh
+8
-5
@@ -104,13 +104,16 @@ test_expect_success 'rev-list can show index objects' '
104
# - we do not show the root tree; since we updated the index, it
105
# does not have a valid cache tree
106
#
107
- cat >expect <<-\EOF &&
108
- 8e4020bb5a8d8c873b25de15933e75cc0fc275df one
109
- d9d3a7417b9605cfd88ee6306b28dadc29e6ab08 only-in-index
110
- 9200b628cf9dc883a85a7abc8d6e6730baee589c two
111
- EOF
107
echo only-in-index >only-in-index &&
108
test_when_finished "git reset --hard" &&
109
+ rev1=$(git rev-parse HEAD:one) &&
110
+ rev2=$(git rev-parse HEAD:two) &&
111
+ revi=$(git hash-object only-in-index) &&
112
+ cat >expect <<-EOF &&
113
+ $rev1 one
114
+ $revi only-in-index
115
+ $rev2 two
116
+ EOF
117
git add only-in-index &&
118
git rev-list --objects --indexed-objects >actual &&
119
test_cmp expect actual