public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox•net>
To: Johannes Schindelin <Johannes.Schindelin@gmx•de>
Cc: git@vger•kernel.org, junkio@cox•net
Subject: Re: [PATCH] bundle: fix wrong check of read_header()'s return value & add tests
Date: Tue, 06 Mar 2007 22:06:24 -0800	[thread overview]
Message-ID: <7vslchio4f.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <Pine.LNX.4.63.0703070613530.22628@wbgn013.biozentrum.uni-wuerzburg.de> (Johannes Schindelin's message of "Wed, 7 Mar 2007 06:15:12 +0100 (CET)")

Johannes Schindelin <Johannes.Schindelin@gmx•de> writes:

> I fear this would suffer the same fate as t8001, namely that some sed 
> would add a newline, which is plain wrong here. This is a workaround:
>
> diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
> index ce96b4b..f895072 100755
> --- a/t/t5510-fetch.sh
> +++ b/t/t5510-fetch.sh
> @@ -110,7 +110,7 @@ test_expect_failure 'unbundle 1' '
>  
>  test_expect_success 'bundle 1 has only 3 files ' '
>  	cd "$D" &&
> -	sed "1,4d" < bundle1 > bundle.pack &&
> +	dd bs=136 skip=1 if=bundle1 of=bundle.pack &&

We might want to reword or enhance the headers later, and 136 is
a horrible workaround.

Would this work?

diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
index ce96b4b..ad589dd 100755
--- a/t/t5510-fetch.sh
+++ b/t/t5510-fetch.sh
@@ -110,9 +110,16 @@ test_expect_failure 'unbundle 1' '
 
 test_expect_success 'bundle 1 has only 3 files ' '
 	cd "$D" &&
-	sed "1,4d" < bundle1 > bundle.pack &&
+	(
+		while read x && test -n "$x"
+		do
+			:;
+		done
+		cat
+	) <bundle1 >bundle.pack &&
 	git index-pack bundle.pack &&
-	test 4 = $(git verify-pack -v bundle.pack | wc -l)
+	verify=$(git verify-pack -v bundle.pack) &&
+	test 4 = $(echo "$verify" | wc -l)
 '
 
 test_expect_success 'unbundle 2' '

  reply	other threads:[~2007-03-07  6:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-06 21:57 [PATCH] bundle: fix wrong check of read_header()'s return value & add tests Johannes Schindelin
2007-03-07  5:15 ` Johannes Schindelin
2007-03-07  6:06   ` Junio C Hamano [this message]
2007-03-08 13:06     ` Johannes Schindelin
2007-03-08 13:58       ` Alex Riesen
2007-03-08 17:12         ` Johannes Schindelin
2007-03-08 20:43           ` Mark Levedahl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vslchio4f.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox$(echo .)net \
    --cc=Johannes.Schindelin@gmx$(echo .)de \
    --cc=git@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox