@@ -290,7 +290,7 @@ test_expect_success 'verify-pack catches mismatched .idx and .pack files' '
290290
291291test_expect_success ' verify-pack catches a corrupted pack signature' '
292292 cat test-1-${packname_1}.pack >test-3.pack &&
293- echo | dd of= test-3.pack count=1 bs=1 conv=notrunc seek= 2 &&
293+ echo | test_overwrite_bytes test-3.pack 2 &&
294294 if git verify-pack test-3.idx
295295 then false
296296 else :;
@@ -299,7 +299,7 @@ test_expect_success 'verify-pack catches a corrupted pack signature' '
299299
300300test_expect_success ' verify-pack catches a corrupted pack version' '
301301 cat test-1-${packname_1}.pack >test-3.pack &&
302- echo | dd of= test-3.pack count=1 bs=1 conv=notrunc seek= 7 &&
302+ echo | test_overwrite_bytes test-3.pack 7 &&
303303 if git verify-pack test-3.idx
304304 then false
305305 else :;
@@ -308,7 +308,7 @@ test_expect_success 'verify-pack catches a corrupted pack version' '
308308
309309test_expect_success ' verify-pack catches a corrupted type/size of the 1st packed object data' '
310310 cat test-1-${packname_1}.pack >test-3.pack &&
311- echo | dd of= test-3.pack count=1 bs=1 conv=notrunc seek= 12 &&
311+ echo | test_overwrite_bytes test-3.pack 12 &&
312312 if git verify-pack test-3.idx
313313 then false
314314 else :;
@@ -319,7 +319,7 @@ test_expect_success 'verify-pack catches a corrupted sum of the index file itsel
319319 l=$(wc -c <test-3.idx) &&
320320 l=$(expr $l - 20) &&
321321 cat test-1-${packname_1}.pack >test-3.pack &&
322- printf "%20s" "" | dd of= test-3.idx count=20 bs=1 conv=notrunc seek= $l &&
322+ printf "%20s" "" | test_overwrite_bytes test-3.idx $l &&
323323 if git verify-pack test-3.pack
324324 then false
325325 else :;
0 commit comments