Skip to content

Commit 5db24dc

Browse files
bk2204gitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d341e08 commit 5db24dc

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

t/t6000-rev-list-misc.sh

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,16 @@ test_expect_success 'rev-list can show index objects' '
104104
# - we do not show the root tree; since we updated the index, it
105105
# does not have a valid cache tree
106106
#
107-
cat >expect <<-\EOF &&
108-
8e4020bb5a8d8c873b25de15933e75cc0fc275df one
109-
d9d3a7417b9605cfd88ee6306b28dadc29e6ab08 only-in-index
110-
9200b628cf9dc883a85a7abc8d6e6730baee589c two
111-
EOF
112107
echo only-in-index >only-in-index &&
113108
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
114117
git add only-in-index &&
115118
git rev-list --objects --indexed-objects >actual &&
116119
test_cmp expect actual

0 commit comments

Comments
 (0)