X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft9300-fast-import.sh;fp=t%2Ft9300-fast-import.sh;h=222d1059ef99879d3db387be798f973fb093f53e;hb=4de0bbd8985ea057050994c5b254c9ef3d845c1e;hp=5a1925f690fe309436a06534addf26a30bc10e1f;hpb=834d9eb6b70a3447c2ad514f9c0e052bc43e8c8a;p=git.git diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh index 5a1925f69..222d1059e 100755 --- a/t/t9300-fast-import.sh +++ b/t/t9300-fast-import.sh @@ -7,6 +7,23 @@ test_description='test git fast-import utility' . ./test-lib.sh . "$TEST_DIRECTORY"/diff-lib.sh ;# test-lib chdir's into trash +# Print $1 bytes from stdin to stdout. +# +# This could be written as "head -c $1", but IRIX "head" does not +# support the -c option. +head_c () { + perl -e ' + my $len = $ARGV[1]; + while ($len > 0) { + my $s; + my $nread = sysread(STDIN, $s, $len); + die "cannot read: $!" unless defined($nread); + print $s; + $len -= $nread; + } + ' - "$1" +} + file2_data='file2 second line of EOF' @@ -1888,44 +1905,41 @@ test_expect_success PIPE 'R: copy using cat-file' ' rm -f blobs && cat >frontend <<-\FRONTEND_END && #!/bin/sh - cat <response && - dd of=blob bs=1 count=$size <&3 && - read newline <&3 && - - cat < $GIT_COMMITTER_DATE - data <blobs - ) && + cat <<-\EOF && + feature cat-blob + blob + mark :1 + data <response && + head_c $size >blob <&3 && + read newline <&3 && + + cat <<-EOF && + commit refs/heads/copied + committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE + data <blobs && git show copied:file3 >actual && test_cmp expect.response response && test_cmp big actual @@ -1953,7 +1967,7 @@ test_expect_success PIPE 'R: print blob mid-commit' ' EOF read blob_id type size <&3 && - dd of=actual bs=1 count=$size <&3 && + head_c $size >actual <&3 && read newline <&3 && echo @@ -1988,7 +2002,7 @@ test_expect_success PIPE 'R: print staged blob within commit' ' echo "cat-blob $to_get" && read blob_id type size <&3 && - dd of=actual bs=1 count=$size <&3 && + head_c $size >actual <&3 && read newline <&3 && echo deleteall