list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
* [Proposed Fix v1] t5318: replace dd if=/dev/zero with truncate
@ 2019-02-08 19:28 randall.s.becker
  0 siblings, 0 replies; only message in thread
From: randall.s.becker @ 2019-02-08 19:28 UTC (permalink / raw)
  To: git; +Cc: Randall S. Becker

From: "Randall S. Becker" <>

The corrupt_graph_and_verify method has been modified to use
truncate instead of the /dev/zero pseudo-device, which breaks on
platforms where the pseudo-device does not exist. truncate extends
files to a specified length filling with nulls, providing a similar
function to the use of dd in this case.

Signed-off-by: Randall S. Becker <>
 t/ | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/ b/t/
index 16d10ebce..d627ffe09 100755
--- a/t/
+++ b/t/
@@ -383,7 +383,7 @@ corrupt_graph_and_verify() {
 	cp $objdir/info/commit-graph commit-graph-backup &&
 	printf "$data" | dd of="$objdir/info/commit-graph" bs=1 seek="$pos" conv=notrunc &&
 	dd of="$objdir/info/commit-graph" bs=1 seek="$zero_pos" count=0 &&
-	dd if=/dev/zero of="$objdir/info/commit-graph" bs=1 seek="$zero_pos" count=$(($orig_size - $zero_pos)) &&
+	truncate -s $orig_size "$objdir/info/commit-graph" &&
 	test_must_fail git commit-graph verify 2>test_err &&
 	grep -v "^+" test_err >err &&
 	test_i18ngrep "$grepstr" err

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-02-08 19:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-08 19:28 [Proposed Fix v1] t5318: replace dd if=/dev/zero with truncate randall.s.becker

Code repositories for project(s) associated with this inbox:

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).