git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 1/1] t0003: Call dd with portable blocksize

From
tboegi@web.de <tboegi@web.de>
Date
Jan 22, 2023, 06:28 UTC
Message-ID
<20230122062839.14542-1-tboegi@web.de>
In-Reply-To
<20230121110505.21362-1-tboegi@web.de>
From: Torsten Bögershausen <tboegi@web.de>

The command `dd bs=101M count=1` is not portable, e.g. dd shipped with MacOs does not understand the 'M'.

Use `bs=1048576 count=101`, which achives the same, instead.
Signed-off-by: Torsten Bögershausen <tboegi@web.de>
---
 t/t0003-attributes.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/t/t0003-attributes.sh b/t/t0003-attributes.sh
index d0284fe2d7..394a08e6d6 100755
--- a/t/t0003-attributes.sh
+++ b/t/t0003-attributes.sh
@@ -400,7 +400,7 @@ test_expect_success 'large attributes line ignores trailing content in tree' '

 test_expect_success EXPENSIVE 'large attributes file ignored in tree' '
 	test_when_finished "rm .gitattributes" &&
-	dd if=/dev/zero of=.gitattributes bs=101M count=1 2>/dev/null &&
+	dd if=/dev/zero of=.gitattributes bs=1048576 count=101 2>/dev/null &&
 	git check-attr --all path >/dev/null 2>err &&
 	echo "warning: ignoring overly large gitattributes file ${SQ}.gitattributes${SQ}" >expect &&
 	test_cmp expect err
@@ -428,7 +428,7 @@ test_expect_success 'large attributes line ignores trailing content in index' '

 test_expect_success EXPENSIVE 'large attributes file ignored in index' '
 	test_when_finished "git update-index --remove .gitattributes" &&
-	blob=$(dd if=/dev/zero bs=101M count=1 2>/dev/null | git hash-object -w --stdin) &&
+	blob=$(dd if=/dev/zero bs=1048576 count=101 2>/dev/null | git hash-object -w --stdin) &&
 	git update-index --add --cacheinfo 100644,$blob,.gitattributes &&
 	git check-attr --cached --all path >/dev/null 2>err &&
 	echo "warning: ignoring overly large gitattributes blob ${SQ}.gitattributes${SQ}" >expect &&
--
2.39.1.254.g904d404274
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 5 in “t0003: Call dd with portable blocksize”
  1. 1/1 t0003: Call dd with portable blocksizetboegi@web.de, Jan 21, 2023
  2. Junio C HamanoJan 22, 2023
  3. 1/1 t0003: Call dd with portable blocksizetboegi@web.de, Jan 22, 2023
  4. Junio C HamanoJan 22, 2023
  5. Torsten BögershausenJan 22, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.