{"thread":{"id":"50441","subject":"[Proposed Fix v1] t5318: replace dd if=/dev/zero with truncate","startedAt":"2019-02-08T19:28:38Z","lastAt":"2019-02-08T19:28:38Z","messageCount":1,"participants":["randall.s.becker@rogers.com"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"368864","messageId":"20190208192818.21488-1-randall.s.becker@rogers.com","threadId":"50441","inReplyTo":null,"subject":"[Proposed Fix v1] t5318: replace dd if=/dev/zero with truncate","fromName":"","fromEmail":"randall.s.becker@rogers.com","sentAt":"2019-02-08T19:28:18Z","receivedAt":"2019-02-08T19:28:38Z","isPatch":false,"sender":{"key":"randall.s.becker@rogers.com","avatar":null},"body":"From: \"Randall S. Becker\" <rsbecker@nexbridge.com>\n\nThe corrupt_graph_and_verify method has been modified to use\ntruncate instead of the /dev/zero pseudo-device, which breaks on\nplatforms where the pseudo-device does not exist. truncate extends\nfiles to a specified length filling with nulls, providing a similar\nfunction to the use of dd in this case.\n\nSigned-off-by: Randall S. Becker <rsbecker@nexbridge.com>\n---\n t/t5318-commit-graph.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t5318-commit-graph.sh b/t/t5318-commit-graph.sh\nindex 16d10ebce..d627ffe09 100755\n--- a/t/t5318-commit-graph.sh\n+++ b/t/t5318-commit-graph.sh\n@@ -383,7 +383,7 @@ corrupt_graph_and_verify() {\n \tcp $objdir/info/commit-graph commit-graph-backup &&\n \tprintf \"$data\" | dd of=\"$objdir/info/commit-graph\" bs=1 seek=\"$pos\" conv=notrunc &&\n \tdd of=\"$objdir/info/commit-graph\" bs=1 seek=\"$zero_pos\" count=0 &&\n-\tdd if=/dev/zero of=\"$objdir/info/commit-graph\" bs=1 seek=\"$zero_pos\" count=$(($orig_size - $zero_pos)) &&\n+\ttruncate -s $orig_size \"$objdir/info/commit-graph\" &&\n \ttest_must_fail git commit-graph verify 2>test_err &&\n \tgrep -v \"^+\" test_err >err &&\n \ttest_i18ngrep \"$grepstr\" err\n-- \n2.12.3\n\n"}]}