Skip to content

Commit 252a4ee

Browse files
bk2204gitster
authored andcommitted
t6501: avoid hard-coded objects
This test contains hard-coded invalid object IDs. Make it hash size independent by generating invalid object IDs using the translation tables. Add a setup target to ensure the output of test_oid_init is checked properly. Signed-off-by: brian m. carlson <[email protected]> Reviewed-by: Eric Sunshine <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 368f3cb commit 252a4ee

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

t/t6501-freshen-objects.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,9 @@ for repack in '' true; do
128128
done
129129

130130
test_expect_success 'do not complain about existing broken links (commit)' '
131-
cat >broken-commit <<-\EOF &&
132-
tree 0000000000000000000000000000000000000001
133-
parent 0000000000000000000000000000000000000002
131+
cat >broken-commit <<-EOF &&
132+
tree $(test_oid 001)
133+
parent $(test_oid 002)
134134
author whatever <[email protected]> 1234 -0000
135135
committer whatever <[email protected]> 1234 -0000
136136
@@ -143,8 +143,8 @@ test_expect_success 'do not complain about existing broken links (commit)' '
143143
'
144144

145145
test_expect_success 'do not complain about existing broken links (tree)' '
146-
cat >broken-tree <<-\EOF &&
147-
100644 blob 0000000000000000000000000000000000000003 foo
146+
cat >broken-tree <<-EOF &&
147+
100644 blob $(test_oid 003) foo
148148
EOF
149149
tree=$(git mktree --missing <broken-tree) &&
150150
git gc -q 2>stderr &&
@@ -153,8 +153,8 @@ test_expect_success 'do not complain about existing broken links (tree)' '
153153
'
154154

155155
test_expect_success 'do not complain about existing broken links (tag)' '
156-
cat >broken-tag <<-\EOF &&
157-
object 0000000000000000000000000000000000000004
156+
cat >broken-tag <<-EOF &&
157+
object $(test_oid 004)
158158
type commit
159159
tag broken
160160
tagger whatever <[email protected]> 1234 -0000

0 commit comments

Comments
 (0)