@@ -315,36 +315,39 @@ test_expect_success '%(deltabase) reports packed delta bases' '
315
315
}
316
316
'
317
317
318
- bogus_type=" bogus"
319
- bogus_content=" bogus"
320
- bogus_size=$( strlen " $bogus_content " )
321
- bogus_sha1=$( echo_without_newline " $bogus_content " | git hash-object -t $bogus_type --literally -w --stdin)
318
+ test_expect_success ' setup bogus data' '
319
+ bogus_short_type="bogus" &&
320
+ bogus_short_content="bogus" &&
321
+ bogus_short_size=$(strlen "$bogus_short_content") &&
322
+ bogus_short_sha1=$(echo_without_newline "$bogus_short_content" | git hash-object -t $bogus_short_type --literally -w --stdin) &&
323
+
324
+ bogus_long_type="abcdefghijklmnopqrstuvwxyz1234679" &&
325
+ bogus_long_content="bogus" &&
326
+ bogus_long_size=$(strlen "$bogus_long_content") &&
327
+ bogus_long_sha1=$(echo_without_newline "$bogus_long_content" | git hash-object -t $bogus_long_type --literally -w --stdin)
328
+ '
322
329
323
330
test_expect_success " Type of broken object is correct" '
324
- echo $bogus_type >expect &&
325
- git cat-file -t --allow-unknown-type $bogus_sha1 >actual &&
331
+ echo $bogus_short_type >expect &&
332
+ git cat-file -t --allow-unknown-type $bogus_short_sha1 >actual &&
326
333
test_cmp expect actual
327
334
'
328
335
329
336
test_expect_success " Size of broken object is correct" '
330
- echo $bogus_size >expect &&
331
- git cat-file -s --allow-unknown-type $bogus_sha1 >actual &&
337
+ echo $bogus_short_size >expect &&
338
+ git cat-file -s --allow-unknown-type $bogus_short_sha1 >actual &&
332
339
test_cmp expect actual
333
340
'
334
- bogus_type=" abcdefghijklmnopqrstuvwxyz1234679"
335
- bogus_content=" bogus"
336
- bogus_size=$( strlen " $bogus_content " )
337
- bogus_sha1=$( echo_without_newline " $bogus_content " | git hash-object -t $bogus_type --literally -w --stdin)
338
341
339
342
test_expect_success " Type of broken object is correct when type is large" '
340
- echo $bogus_type >expect &&
341
- git cat-file -t --allow-unknown-type $bogus_sha1 >actual &&
343
+ echo $bogus_long_type >expect &&
344
+ git cat-file -t --allow-unknown-type $bogus_long_sha1 >actual &&
342
345
test_cmp expect actual
343
346
'
344
347
345
348
test_expect_success " Size of large broken object is correct when type is large" '
346
- echo $bogus_size >expect &&
347
- git cat-file -s --allow-unknown-type $bogus_sha1 >actual &&
349
+ echo $bogus_long_size >expect &&
350
+ git cat-file -s --allow-unknown-type $bogus_long_sha1 >actual &&
348
351
test_cmp expect actual
349
352
'
350
353
0 commit comments