Re: [PATCH v2] Tolerate zlib deflation with window size < 32Kb
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 8, 2011, 19:23 UTC
- Message-ID
- <7v62m7yagb.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <1312742773-26373-1-git-send-email-roberto.tyley@gmail.com>
roberto.tyley@gmail.com writes:
Show 5 quoted lines
> +. ./test-lib.sh
> +
> +assert_blob_equals() {
> + echo -n $2 > expected &&
> + git cat-file -p $1 > actual &&Needs proper quoting with dq.
Show 13 quoted lines
> + test_cmp expected actual > +} > + > +test_expect_success setup ' > + cp -R ../t1013/objects .git/ > + git --version > +' > + > +test_expect_success 'read standard-format loose objects' ' > + git cat-file tag 8d4e360d6c70fbd72411991c02a09c442cf7a9fa && > + git cat-file commit 6baee0540ea990d9761a3eb9ab183003a71c3696 && > + git ls-tree 7a37b887a73791d12d26c0d3e39568a8fb0fa6e8 && > + assert_blob_equals "257cc5642cb1a054f08cc83f2d943e56fd3ebe99" "foo\n"
Isn't it unportable to expect "\n" to be kept or expanded by "echo"?
Will squash the following in (and I have another patch on top to consolidate the definition of $LF in this and other test scripts).
Thanks.
-- >8 -- Subject: [PATCH] fixup! Tolerate zlib deflation with window
Signed-off-by: Junio C Hamano <gitster@pobox.com> --- t/t1013-loose-object-format.sh | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/t/t1013-loose-object-format.sh b/t/t1013-loose-object-format.sh index b5ac46d..36b4027 100755 --- a/t/t1013-loose-object-format.sh +++ b/t/t1013-loose-object-format.sh @@ -26,10 +26,12 @@ standard format, deflated with 4KB window size: Agit/JGit on Android ' . ./test-lib.sh +LF=' +' assert_blob_equals() { - echo -n $2 > expected && - git cat-file -p $1 > actual && + printf "%s" "$2" >expected && + git cat-file -p "$1" >actual && test_cmp expected actual } @@ -42,7 +44,7 @@ test_expect_success 'read standard-format loose objects' ' git cat-file tag 8d4e360d6c70fbd72411991c02a09c442cf7a9fa && git cat-file commit 6baee0540ea990d9761a3eb9ab183003a71c3696 && git ls-tree 7a37b887a73791d12d26c0d3e39568a8fb0fa6e8 && - assert_blob_equals "257cc5642cb1a054f08cc83f2d943e56fd3ebe99" "foo\n" + assert_blob_equals "257cc5642cb1a054f08cc83f2d943e56fd3ebe99" "foo$LF" ' test_expect_success 'read experimental-format loose objects' '
-- 1.7.6.409.ge7a85