t1006: rename sha1 to oid

Before I extend this test, changing the naming of the relevant hash from sha1 to oid. Calling the hash sha1 is incorrect today as it can be either sha1 or sha256 depending on the value of GIT_DEFAULT_HASH_FUNCTION when the test is called. I plan to test sha1 and sha256 simultaneously in the same repository. Having a name like sha1 will be even more confusing. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Eric W. Biederman committed Oct 1, 2023 at 21:40 UTC baab175c1d2f51bb02a1af5afd1fe2daffed0f75
1 file changed +110 -110
t/t1006-cat-file.sh
+110 -110
@@ -112,65 +112,65 @@ strlen () {
112
113 run_tests () {
114 type=$1
115 - sha1=$2
115 + oid=$2
116 size=$3
117 content=$4
118 pretty_content=$5
119
120 - batch_output="$sha1 $type $size
120 + batch_output="$oid $type $size
121 $content"
122
123 test_expect_success "$type exists" '
124 - git cat-file -e $sha1
124 + git cat-file -e $oid
125 '
126
127 test_expect_success "Type of $type is correct" '
128 echo $type >expect &&
129 - git cat-file -t $sha1 >actual &&
129 + git cat-file -t $oid >actual &&
130 test_cmp expect actual
131 '
132
133 test_expect_success "Size of $type is correct" '
134 echo $size >expect &&
135 - git cat-file -s $sha1 >actual &&
135 + git cat-file -s $oid >actual &&
136 test_cmp expect actual
137 '
138
139 test_expect_success "Type of $type is correct using --allow-unknown-type" '
140 echo $type >expect &&
141 - git cat-file -t --allow-unknown-type $sha1 >actual &&
141 + git cat-file -t --allow-unknown-type $oid >actual &&
142 test_cmp expect actual
143 '
144
145 test_expect_success "Size of $type is correct using --allow-unknown-type" '
146 echo $size >expect &&
147 - git cat-file -s --allow-unknown-type $sha1 >actual &&
147 + git cat-file -s --allow-unknown-type $oid >actual &&
148 test_cmp expect actual
149 '
150
151 test -z "$content" ||
152 test_expect_success "Content of $type is correct" '
153 echo_without_newline "$content" >expect &&
154 - git cat-file $type $sha1 >actual &&
154 + git cat-file $type $oid >actual &&
155 test_cmp expect actual
156 '
157
158 test_expect_success "Pretty content of $type is correct" '
159 echo_without_newline "$pretty_content" >expect &&
160 - git cat-file -p $sha1 >actual &&
160 + git cat-file -p $oid >actual &&
161 test_cmp expect actual
162 '
163
164 test -z "$content" ||
165 test_expect_success "--batch output of $type is correct" '
166 echo "$batch_output" >expect &&
167 - echo $sha1 | git cat-file --batch >actual &&
167 + echo $oid | git cat-file --batch >actual &&
168 test_cmp expect actual
169 '
170
171 test_expect_success "--batch-check output of $type is correct" '
172 - echo "$sha1 $type $size" >expect &&
173 - echo_without_newline $sha1 | git cat-file --batch-check >actual &&
172 + echo "$oid $type $size" >expect &&
173 + echo_without_newline $oid | git cat-file --batch-check >actual &&
174 test_cmp expect actual
175 '
176
@@ -179,33 +179,33 @@ $content"
179 test -z "$content" ||
180 test_expect_success "--batch-command $opt output of $type content is correct" '
181 echo "$batch_output" >expect &&
182 - test_write_lines "contents $sha1" | git cat-file --batch-command $opt >actual &&
182 + test_write_lines "contents $oid" | git cat-file --batch-command $opt >actual &&
183 test_cmp expect actual
184 '
185
186 test_expect_success "--batch-command $opt output of $type info is correct" '
187 - echo "$sha1 $type $size" >expect &&
188 - test_write_lines "info $sha1" |
187 + echo "$oid $type $size" >expect &&
188 + test_write_lines "info $oid" |
189 git cat-file --batch-command $opt >actual &&
190 test_cmp expect actual
191 '
192 done
193
194 test_expect_success "custom --batch-check format" '
195 - echo "$type $sha1" >expect &&
196 - echo $sha1 | git cat-file --batch-check="%(objecttype) %(objectname)" >actual &&
195 + echo "$type $oid" >expect &&
196 + echo $oid | git cat-file --batch-check="%(objecttype) %(objectname)" >actual &&
197 test_cmp expect actual
198 '
199
200 test_expect_success "custom --batch-command format" '
201 - echo "$type $sha1" >expect &&
202 - echo "info $sha1" | git cat-file --batch-command="%(objecttype) %(objectname)" >actual &&
201 + echo "$type $oid" >expect &&
202 + echo "info $oid" | git cat-file --batch-command="%(objecttype) %(objectname)" >actual &&
203 test_cmp expect actual
204 '
205
206 test_expect_success '--batch-check with %(rest)' '
207 echo "$type this is some extra content" >expect &&
208 - echo "$sha1 this is some extra content" |
208 + echo "$oid this is some extra content" |
209 git cat-file --batch-check="%(objecttype) %(rest)" >actual &&
210 test_cmp expect actual
211 '
@@ -216,7 +216,7 @@ $content"
216 echo "$size" &&
217 echo "$content"
218 } >expect &&
219 - echo $sha1 | git cat-file --batch="%(objectsize)" >actual &&
219 + echo $oid | git cat-file --batch="%(objectsize)" >actual &&
220 test_cmp expect actual
221 '
222
@@ -226,25 +226,25 @@ $content"
226 echo "$type" &&
227 echo "$content"
228 } >expect &&
229 - echo $sha1 | git cat-file --batch="%(objecttype)" >actual &&
229 + echo $oid | git cat-file --batch="%(objecttype)" >actual &&
230 test_cmp expect actual
231 '
232 }
233
234 hello_content="Hello World"
235 hello_size=$(strlen "$hello_content")
236 -hello_sha1=$(echo_without_newline "$hello_content" | git hash-object --stdin)
236 +hello_oid=$(echo_without_newline "$hello_content" | git hash-object --stdin)
237
238 test_expect_success "setup" '
239 echo_without_newline "$hello_content" > hello &&
240 git update-index --add hello
241 '
242
243 -run_tests 'blob' $hello_sha1 $hello_size "$hello_content" "$hello_content"
243 +run_tests 'blob' $hello_oid $hello_size "$hello_content" "$hello_content"
244
245 test_expect_success '--batch-command --buffer with flush for blob info' '
246 - echo "$hello_sha1 blob $hello_size" >expect &&
247 - test_write_lines "info $hello_sha1" "flush" |
246 + echo "$hello_oid blob $hello_size" >expect &&
247 + test_write_lines "info $hello_oid" "flush" |
248 GIT_TEST_CAT_FILE_NO_FLUSH_ON_EXIT=1 \
249 git cat-file --batch-command --buffer >actual &&
250 test_cmp expect actual
@@ -252,38 +252,38 @@ test_expect_success '--batch-command --buffer with flush for blob info' '
252
253 test_expect_success '--batch-command --buffer without flush for blob info' '
254 touch output &&
255 - test_write_lines "info $hello_sha1" |
255 + test_write_lines "info $hello_oid" |
256 GIT_TEST_CAT_FILE_NO_FLUSH_ON_EXIT=1 \
257 git cat-file --batch-command --buffer >>output &&
258 test_must_be_empty output
259 '
260
261 test_expect_success '--batch-check without %(rest) considers whole line' '
262 - echo "$hello_sha1 blob $hello_size" >expect &&
263 - git update-index --add --cacheinfo 100644 $hello_sha1 "white space" &&
262 + echo "$hello_oid blob $hello_size" >expect &&
263 + git update-index --add --cacheinfo 100644 $hello_oid "white space" &&
264 test_when_finished "git update-index --remove \"white space\"" &&
265 echo ":white space" | git cat-file --batch-check >actual &&
266 test_cmp expect actual
267 '
268
269 -tree_sha1=$(git write-tree)
269 +tree_oid=$(git write-tree)
270 tree_size=$(($(test_oid rawsz) + 13))
271 -tree_pretty_content="100644 blob $hello_sha1 hello${LF}"
271 +tree_pretty_content="100644 blob $hello_oid hello${LF}"
272
273 -run_tests 'tree' $tree_sha1 $tree_size "" "$tree_pretty_content"
273 +run_tests 'tree' $tree_oid $tree_size "" "$tree_pretty_content"
274
275 commit_message="Initial commit"
276 -commit_sha1=$(echo_without_newline "$commit_message" | git commit-tree $tree_sha1)
276 +commit_oid=$(echo_without_newline "$commit_message" | git commit-tree $tree_oid)
277 commit_size=$(($(test_oid hexsz) + 137))
278 -commit_content="tree $tree_sha1
278 +commit_content="tree $tree_oid
279 author $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL> $GIT_AUTHOR_DATE
280 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
281
282 $commit_message"
283
284 -run_tests 'commit' $commit_sha1 $commit_size "$commit_content" "$commit_content"
284 +run_tests 'commit' $commit_oid $commit_size "$commit_content" "$commit_content"
285
286 -tag_header_without_timestamp="object $hello_sha1
286 +tag_header_without_timestamp="object $hello_oid
287 type blob
288 tag hellotag
289 tagger $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>"
@@ -292,14 +292,14 @@ tag_content="$tag_header_without_timestamp 0 +0000
292
293 $tag_description"
294
295 -tag_sha1=$(echo_without_newline "$tag_content" | git hash-object -t tag --stdin -w)
295 +tag_oid=$(echo_without_newline "$tag_content" | git hash-object -t tag --stdin -w)
296 tag_size=$(strlen "$tag_content")
297
298 -run_tests 'tag' $tag_sha1 $tag_size "$tag_content" "$tag_content"
298 +run_tests 'tag' $tag_oid $tag_size "$tag_content" "$tag_content"
299
300 test_expect_success "Reach a blob from a tag pointing to it" '
301 echo_without_newline "$hello_content" >expect &&
302 - git cat-file blob $tag_sha1 >actual &&
302 + git cat-file blob $tag_oid >actual &&
303 test_cmp expect actual
304 '
305
@@ -308,31 +308,31 @@ do
308 for opt in t s e p
309 do
310 test_expect_success "Passing -$opt with --$batch fails" '
311 - test_must_fail git cat-file --$batch -$opt $hello_sha1
311 + test_must_fail git cat-file --$batch -$opt $hello_oid
312 '
313
314 test_expect_success "Passing --$batch with -$opt fails" '
315 - test_must_fail git cat-file -$opt --$batch $hello_sha1
315 + test_must_fail git cat-file -$opt --$batch $hello_oid
316 '
317 done
318
319 test_expect_success "Passing <type> with --$batch fails" '
320 - test_must_fail git cat-file --$batch blob $hello_sha1
320 + test_must_fail git cat-file --$batch blob $hello_oid
321 '
322
323 test_expect_success "Passing --$batch with <type> fails" '
324 - test_must_fail git cat-file blob --$batch $hello_sha1
324 + test_must_fail git cat-file blob --$batch $hello_oid
325 '
326
327 - test_expect_success "Passing sha1 with --$batch fails" '
328 - test_must_fail git cat-file --$batch $hello_sha1
327 + test_expect_success "Passing oid with --$batch fails" '
328 + test_must_fail git cat-file --$batch $hello_oid
329 '
330 done
331
332 for opt in t s e p
333 do
334 test_expect_success "Passing -$opt with --follow-symlinks fails" '
335 - test_must_fail git cat-file --follow-symlinks -$opt $hello_sha1
335 + test_must_fail git cat-file --follow-symlinks -$opt $hello_oid
336 '
337 done
338
@@ -360,12 +360,12 @@ test_expect_success "--batch-check for a non-existent hash" '
360
361 test_expect_success "--batch for an existent and a non-existent hash" '
362 cat >expect <<-EOF &&
363 - $tag_sha1 tag $tag_size
363 + $tag_oid tag $tag_size
364 $tag_content
365 0000000000000000000000000000000000000000 missing
366 EOF
367
368 - printf "$tag_sha1\n0000000000000000000000000000000000000000" >in &&
368 + printf "$tag_oid\n0000000000000000000000000000000000000000" >in &&
369 git cat-file --batch <in >actual &&
370 test_cmp expect actual
371 '
@@ -386,74 +386,74 @@ test_expect_success 'empty --batch-check notices missing object' '
386 test_cmp expect actual
387 '
388
389 -batch_input="$hello_sha1
390 -$commit_sha1
391 -$tag_sha1
389 +batch_input="$hello_oid
390 +$commit_oid
391 +$tag_oid
392 deadbeef
393
394 "
395
396 printf "%s\0" \
397 - "$hello_sha1 blob $hello_size" \
397 + "$hello_oid blob $hello_size" \
398 "$hello_content" \
399 - "$commit_sha1 commit $commit_size" \
399 + "$commit_oid commit $commit_size" \
400 "$commit_content" \
401 - "$tag_sha1 tag $tag_size" \
401 + "$tag_oid tag $tag_size" \
402 "$tag_content" \
403 "deadbeef missing" \
404 " missing" >batch_output
405
406 -test_expect_success '--batch with multiple sha1s gives correct format' '
406 +test_expect_success '--batch with multiple oids gives correct format' '
407 tr "\0" "\n" <batch_output >expect &&
408 echo_without_newline "$batch_input" >in &&
409 git cat-file --batch <in >actual &&
410 test_cmp expect actual
411 '
412
413 -test_expect_success '--batch, -z with multiple sha1s gives correct format' '
413 +test_expect_success '--batch, -z with multiple oids gives correct format' '
414 echo_without_newline_nul "$batch_input" >in &&
415 tr "\0" "\n" <batch_output >expect &&
416 git cat-file --batch -z <in >actual &&
417 test_cmp expect actual
418 '
419
420 -test_expect_success '--batch, -Z with multiple sha1s gives correct format' '
420 +test_expect_success '--batch, -Z with multiple oids gives correct format' '
421 echo_without_newline_nul "$batch_input" >in &&
422 git cat-file --batch -Z <in >actual &&
423 test_cmp batch_output actual
424 '
425
426 -batch_check_input="$hello_sha1
427 -$tree_sha1
428 -$commit_sha1
429 -$tag_sha1
426 +batch_check_input="$hello_oid
427 +$tree_oid
428 +$commit_oid
429 +$tag_oid
430 deadbeef
431
432 "
433
434 printf "%s\0" \
435 - "$hello_sha1 blob $hello_size" \
436 - "$tree_sha1 tree $tree_size" \
437 - "$commit_sha1 commit $commit_size" \
438 - "$tag_sha1 tag $tag_size" \
435 + "$hello_oid blob $hello_size" \
436 + "$tree_oid tree $tree_size" \
437 + "$commit_oid commit $commit_size" \
438 + "$tag_oid tag $tag_size" \
439 "deadbeef missing" \
440 " missing" >batch_check_output
441
442 -test_expect_success "--batch-check with multiple sha1s gives correct format" '
442 +test_expect_success "--batch-check with multiple oids gives correct format" '
443 tr "\0" "\n" <batch_check_output >expect &&
444 echo_without_newline "$batch_check_input" >in &&
445 git cat-file --batch-check <in >actual &&
446 test_cmp expect actual
447 '
448
449 -test_expect_success "--batch-check, -z with multiple sha1s gives correct format" '
449 +test_expect_success "--batch-check, -z with multiple oids gives correct format" '
450 tr "\0" "\n" <batch_check_output >expect &&
451 echo_without_newline_nul "$batch_check_input" >in &&
452 git cat-file --batch-check -z <in >actual &&
453 test_cmp expect actual
454 '
455
456 -test_expect_success "--batch-check, -Z with multiple sha1s gives correct format" '
456 +test_expect_success "--batch-check, -Z with multiple oids gives correct format" '
457 echo_without_newline_nul "$batch_check_input" >in &&
458 git cat-file --batch-check -Z <in >actual &&
459 test_cmp batch_check_output actual
@@ -480,18 +480,18 @@ test_expect_success FUNNYNAMES '--batch-check, -Z with newline in input' '
480 test_cmp expect actual
481 '
482
483 -batch_command_multiple_info="info $hello_sha1
484 -info $tree_sha1
485 -info $commit_sha1
486 -info $tag_sha1
483 +batch_command_multiple_info="info $hello_oid
484 +info $tree_oid
485 +info $commit_oid
486 +info $tag_oid
487 info deadbeef"
488
489 test_expect_success '--batch-command with multiple info calls gives correct format' '
490 cat >expect <<-EOF &&
491 - $hello_sha1 blob $hello_size
492 - $tree_sha1 tree $tree_size
493 - $commit_sha1 commit $commit_size
494 - $tag_sha1 tag $tag_size
491 + $hello_oid blob $hello_size
492 + $tree_oid tree $tree_size
493 + $commit_oid commit $commit_size
494 + $tag_oid tag $tag_size
495 deadbeef missing
496 EOF
497
@@ -512,19 +512,19 @@ test_expect_success '--batch-command with multiple info calls gives correct form
512 test_cmp expect_nul actual
513 '
514
515 -batch_command_multiple_contents="contents $hello_sha1
516 -contents $commit_sha1
517 -contents $tag_sha1
515 +batch_command_multiple_contents="contents $hello_oid
516 +contents $commit_oid
517 +contents $tag_oid
518 contents deadbeef
519 flush"
520
521 test_expect_success '--batch-command with multiple command calls gives correct format' '
522 printf "%s\0" \
523 - "$hello_sha1 blob $hello_size" \
523 + "$hello_oid blob $hello_size" \
524 "$hello_content" \
525 - "$commit_sha1 commit $commit_size" \
525 + "$commit_oid commit $commit_size" \
526 "$commit_content" \
527 - "$tag_sha1 tag $tag_size" \
527 + "$tag_oid tag $tag_size" \
528 "$tag_content" \
529 "deadbeef missing" >expect_nul &&
530 tr "\0" "\n" <expect_nul >expect &&
@@ -569,7 +569,7 @@ test_expect_success 'confirm that neither loose blob is a delta' '
569 # we will check only that one of the two objects is a delta
570 # against the other, but not the order. We can do so by just
571 # asking for the base of both, and checking whether either
572 -# sha1 appears in the output.
572 +# oid appears in the output.
573 test_expect_success '%(deltabase) reports packed delta bases' '
574 git repack -ad &&
575 git cat-file --batch-check="%(deltabase)" <blobs >actual &&
@@ -583,12 +583,12 @@ test_expect_success 'setup bogus data' '
583 bogus_short_type="bogus" &&
584 bogus_short_content="bogus" &&
585 bogus_short_size=$(strlen "$bogus_short_content") &&
586 - bogus_short_sha1=$(echo_without_newline "$bogus_short_content" | git hash-object -t $bogus_short_type --literally -w --stdin) &&
586 + bogus_short_oid=$(echo_without_newline "$bogus_short_content" | git hash-object -t $bogus_short_type --literally -w --stdin) &&
587
588 bogus_long_type="abcdefghijklmnopqrstuvwxyz1234679" &&
589 bogus_long_content="bogus" &&
590 bogus_long_size=$(strlen "$bogus_long_content") &&
591 - bogus_long_sha1=$(echo_without_newline "$bogus_long_content" | git hash-object -t $bogus_long_type --literally -w --stdin)
591 + bogus_long_oid=$(echo_without_newline "$bogus_long_content" | git hash-object -t $bogus_long_type --literally -w --stdin)
592 '
593
594 for arg1 in '' --allow-unknown-type
@@ -608,9 +608,9 @@ do
608
609 if test "$arg1" = "--allow-unknown-type"
610 then
611 - git cat-file $arg1 $arg2 $bogus_short_sha1
611 + git cat-file $arg1 $arg2 $bogus_short_oid
612 else
613 - test_must_fail git cat-file $arg1 $arg2 $bogus_short_sha1 >out 2>actual &&
613 + test_must_fail git cat-file $arg1 $arg2 $bogus_short_oid >out 2>actual &&
614 test_must_be_empty out &&
615 test_cmp expect actual
616 fi
@@ -620,21 +620,21 @@ do
620 if test "$arg2" = "-p"
621 then
622 cat >expect <<-EOF
623 - error: header for $bogus_long_sha1 too long, exceeds 32 bytes
624 - fatal: Not a valid object name $bogus_long_sha1
623 + error: header for $bogus_long_oid too long, exceeds 32 bytes
624 + fatal: Not a valid object name $bogus_long_oid
625 EOF
626 else
627 cat >expect <<-EOF
628 - error: header for $bogus_long_sha1 too long, exceeds 32 bytes
628 + error: header for $bogus_long_oid too long, exceeds 32 bytes
629 fatal: git cat-file: could not get object info
630 EOF
631 fi &&
632
633 if test "$arg1" = "--allow-unknown-type"
634 then
635 - git cat-file $arg1 $arg2 $bogus_short_sha1
635 + git cat-file $arg1 $arg2 $bogus_short_oid
636 else
637 - test_must_fail git cat-file $arg1 $arg2 $bogus_long_sha1 >out 2>actual &&
637 + test_must_fail git cat-file $arg1 $arg2 $bogus_long_oid >out 2>actual &&
638 test_must_be_empty out &&
639 test_cmp expect actual
640 fi
@@ -668,28 +668,28 @@ do
668 done
669
670 test_expect_success '-e is OK with a broken object without --allow-unknown-type' '
671 - git cat-file -e $bogus_short_sha1
671 + git cat-file -e $bogus_short_oid
672 '
673
674 test_expect_success '-e can not be combined with --allow-unknown-type' '
675 - test_expect_code 128 git cat-file -e --allow-unknown-type $bogus_short_sha1
675 + test_expect_code 128 git cat-file -e --allow-unknown-type $bogus_short_oid
676 '
677
678 test_expect_success '-p cannot print a broken object even with --allow-unknown-type' '
679 - test_must_fail git cat-file -p $bogus_short_sha1 &&
680 - test_expect_code 128 git cat-file -p --allow-unknown-type $bogus_short_sha1
679 + test_must_fail git cat-file -p $bogus_short_oid &&
680 + test_expect_code 128 git cat-file -p --allow-unknown-type $bogus_short_oid
681 '
682
683 test_expect_success '<type> <hash> does not work with objects of broken types' '
684 cat >err.expect <<-\EOF &&
685 fatal: invalid object type "bogus"
686 EOF
687 - test_must_fail git cat-file $bogus_short_type $bogus_short_sha1 2>err.actual &&
687 + test_must_fail git cat-file $bogus_short_type $bogus_short_oid 2>err.actual &&
688 test_cmp err.expect err.actual
689 '
690
691 test_expect_success 'broken types combined with --batch and --batch-check' '
692 - echo $bogus_short_sha1 >bogus-oid &&
692 + echo $bogus_short_oid >bogus-oid &&
693
694 cat >err.expect <<-\EOF &&
695 fatal: invalid object type
@@ -711,52 +711,52 @@ test_expect_success 'the --allow-unknown-type option does not consider replaceme
711 cat >expect <<-EOF &&
712 $bogus_short_type
713 EOF
714 - git cat-file -t --allow-unknown-type $bogus_short_sha1 >actual &&
714 + git cat-file -t --allow-unknown-type $bogus_short_oid >actual &&
715 test_cmp expect actual &&
716
717 # Create it manually, as "git replace" will die on bogus
718 # types.
719 head=$(git rev-parse --verify HEAD) &&
720 - test_when_finished "test-tool ref-store main delete-refs 0 msg refs/replace/$bogus_short_sha1" &&
721 - test-tool ref-store main update-ref msg "refs/replace/$bogus_short_sha1" $head $ZERO_OID REF_SKIP_OID_VERIFICATION &&
720 + test_when_finished "test-tool ref-store main delete-refs 0 msg refs/replace/$bogus_short_oid" &&
721 + test-tool ref-store main update-ref msg "refs/replace/$bogus_short_oid" $head $ZERO_OID REF_SKIP_OID_VERIFICATION &&
722
723 cat >expect <<-EOF &&
724 commit
725 EOF
726 - git cat-file -t --allow-unknown-type $bogus_short_sha1 >actual &&
726 + git cat-file -t --allow-unknown-type $bogus_short_oid >actual &&
727 test_cmp expect actual
728 '
729
730 test_expect_success "Type of broken object is correct" '
731 echo $bogus_short_type >expect &&
732 - git cat-file -t --allow-unknown-type $bogus_short_sha1 >actual &&
732 + git cat-file -t --allow-unknown-type $bogus_short_oid >actual &&
733 test_cmp expect actual
734 '
735
736 test_expect_success "Size of broken object is correct" '
737 echo $bogus_short_size >expect &&
738 - git cat-file -s --allow-unknown-type $bogus_short_sha1 >actual &&
738 + git cat-file -s --allow-unknown-type $bogus_short_oid >actual &&
739 test_cmp expect actual
740 '
741
742 test_expect_success 'clean up broken object' '
743 - rm .git/objects/$(test_oid_to_path $bogus_short_sha1)
743 + rm .git/objects/$(test_oid_to_path $bogus_short_oid)
744 '
745
746 test_expect_success "Type of broken object is correct when type is large" '
747 echo $bogus_long_type >expect &&
748 - git cat-file -t --allow-unknown-type $bogus_long_sha1 >actual &&
748 + git cat-file -t --allow-unknown-type $bogus_long_oid >actual &&
749 test_cmp expect actual
750 '
751
752 test_expect_success "Size of large broken object is correct when type is large" '
753 echo $bogus_long_size >expect &&
754 - git cat-file -s --allow-unknown-type $bogus_long_sha1 >actual &&
754 + git cat-file -s --allow-unknown-type $bogus_long_oid >actual &&
755 test_cmp expect actual
756 '
757
758 test_expect_success 'clean up broken object' '
759 - rm .git/objects/$(test_oid_to_path $bogus_long_sha1)
759 + rm .git/objects/$(test_oid_to_path $bogus_long_oid)
760 '
761
762 test_expect_success 'cat-file -t and -s on corrupt loose object' '
@@ -853,7 +853,7 @@ test_expect_success 'prep for symlink tests' '
853 test_ln_s_add loop2 loop1 &&
854 git add morx dir/subdir/ind2 dir/ind1 &&
855 git commit -am "test" &&
856 - echo $hello_sha1 blob $hello_size >found
856 + echo $hello_oid blob $hello_size >found
857 '
858
859 test_expect_success 'git cat-file --batch-check --follow-symlinks works for non-links' '
@@ -941,7 +941,7 @@ test_expect_success 'git cat-file --batch-check --follow-symlinks works for dir/
941 echo HEAD:dirlink/morx >>expect &&
942 echo HEAD:dirlink/morx | git cat-file --batch-check --follow-symlinks >actual &&
943 test_cmp expect actual &&
944 - echo $hello_sha1 blob $hello_size >expect &&
944 + echo $hello_oid blob $hello_size >expect &&
945 echo HEAD:dirlink/ind1 | git cat-file --batch-check --follow-symlinks >actual &&
946 test_cmp expect actual
947 '