summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 491e359)
raw | patch | inline | side by side (parent: 491e359)
author | Jonathan Nieder <jrnieder@gmail.com> | |
Mon, 13 Dec 2010 06:31:51 +0000 (00:31 -0600) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 13 Dec 2010 07:17:44 +0000 (23:17 -0800) |
dd is a thin wrapper around read(2). As open group Issue 7 explains:
It shall read the input one block at a time, using the specified
input block size; it shall then process the block of data
actually returned, which could be smaller than the requested
block size.
Any short read --- for example from a pipe whose capacity cannot fill
a block --- results in that block being truncated. As a result, the
first cat-blob test (9300.114) fails on Mac OS X, where the pipe
capacity is around 8 KiB.
Fix the test by using a block size of 1. Each read will block until
the next byte of input is available.
It would be even nicer to use head -c which expresses the intention
more clearly. Alas, IRIX "head" does not support the -c option.
Reported-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
It shall read the input one block at a time, using the specified
input block size; it shall then process the block of data
actually returned, which could be smaller than the requested
block size.
Any short read --- for example from a pipe whose capacity cannot fill
a block --- results in that block being truncated. As a result, the
first cat-blob test (9300.114) fails on Mac OS X, where the pipe
capacity is around 8 KiB.
Fix the test by using a block size of 1. Each read will block until
the next byte of input is available.
It would be even nicer to use head -c which expresses the intention
more clearly. Alas, IRIX "head" does not support the -c option.
Reported-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t9300-fast-import.sh | patch | blob | history |
diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index 055ddc6ddc711de51eb53660572d4527c68450fb..ed28d3cc83a37bb45b92dbb507112c4b22d01040 100755 (executable)
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
read blob_id type size <&3 &&
echo "$blob_id $type $size" >response &&
- dd of=blob bs=$size count=1 <&3 &&
+ dd of=blob bs=1 count=$size <&3 &&
read newline <&3 &&
cat <<EOF &&
EOF
read blob_id type size <&3 &&
- dd of=actual bs=$size count=1 <&3 &&
+ dd of=actual bs=1 count=$size <&3 &&
read newline <&3 &&
echo
echo "cat-blob $to_get" &&
read blob_id type size <&3 &&
- dd of=actual bs=$size count=1 <&3 &&
+ dd of=actual bs=1 count=$size <&3 &&
read newline <&3 &&
echo deleteall