git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] t5701: "wc -l" may add whitespace
@ 2007-08-29 16:52 Johannes Schindelin
  2007-08-29 16:55 ` Matthieu Moy
  2007-08-30  6:13 ` Junio C Hamano
  0 siblings, 2 replies; 5+ messages in thread
From: Johannes Schindelin @ 2007-08-29 16:52 UTC (permalink / raw)
  To: gitster, git


Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---

	Found in msysGit... MSys' wc seems to suffer the same defect that 
	OSX' wc has...

 t/t5701-clone-local.sh |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/t/t5701-clone-local.sh b/t/t5701-clone-local.sh
index d2f55eb..7e7019f 100755
--- a/t/t5701-clone-local.sh
+++ b/t/t5701-clone-local.sh
@@ -54,8 +54,7 @@ test_expect_success 'With -no-hardlinks, local will make a copy' '
 	cd "$D" &&
 	git clone --bare --no-hardlinks x w &&
 	cd w &&
-	linked=$(find objects -type f ! -links 1 | wc -l) &&
-	test "$linked" = 0
+	test $(find objects -type f ! -links 1 | wc -l) = 0
 '
 
 test_expect_success 'Even without -l, local will make a hardlink' '
@@ -63,8 +62,7 @@ test_expect_success 'Even without -l, local will make a hardlink' '
 	rm -fr w &&
 	git clone -l --bare x w &&
 	cd w &&
-	copied=$(find objects -type f -links 1 | wc -l) &&
-	test "$copied" = 0
+	test $(find objects -type f -links 1 | wc -l) = 0
 '
 
 test_done
-- 
1.5.3.rc7.2.g2d7f

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] t5701: "wc -l" may add whitespace
  2007-08-29 16:52 [PATCH] t5701: "wc -l" may add whitespace Johannes Schindelin
@ 2007-08-29 16:55 ` Matthieu Moy
  2007-08-29 17:00   ` Johannes Schindelin
  2007-08-30  6:13 ` Junio C Hamano
  1 sibling, 1 reply; 5+ messages in thread
From: Matthieu Moy @ 2007-08-29 16:55 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: gitster, git

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

> -	linked=$(find objects -type f ! -links 1 | wc -l) &&
> -	test "$linked" = 0
> +	test $(find objects -type f ! -links 1 | wc -l) = 0

You can also use "test x -eq y" to compare integers.

I don't know which one is the most portable.

-- 
Matthieu

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] t5701: "wc -l" may add whitespace
  2007-08-29 16:55 ` Matthieu Moy
@ 2007-08-29 17:00   ` Johannes Schindelin
  0 siblings, 0 replies; 5+ messages in thread
From: Johannes Schindelin @ 2007-08-29 17:00 UTC (permalink / raw)
  To: Matthieu Moy; +Cc: gitster, git

Hi,

On Wed, 29 Aug 2007, Matthieu Moy wrote:

> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
> > -	linked=$(find objects -type f ! -links 1 | wc -l) &&
> > -	test "$linked" = 0
> > +	test $(find objects -type f ! -links 1 | wc -l) = 0
> 
> You can also use "test x -eq y" to compare integers.
> 
> I don't know which one is the most portable.

Who cares when my version is obviously portable?

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] t5701: "wc -l" may add whitespace
  2007-08-29 16:52 [PATCH] t5701: "wc -l" may add whitespace Johannes Schindelin
  2007-08-29 16:55 ` Matthieu Moy
@ 2007-08-30  6:13 ` Junio C Hamano
  2007-08-30  9:26   ` Johannes Schindelin
  1 sibling, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2007-08-30  6:13 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: git

Isn't this already in as 70f64148bf7ca5136f2aa18c41b3b8f4bebfd138
(Fix t5701-clone-local for white space from wc)?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] t5701: "wc -l" may add whitespace
  2007-08-30  6:13 ` Junio C Hamano
@ 2007-08-30  9:26   ` Johannes Schindelin
  0 siblings, 0 replies; 5+ messages in thread
From: Johannes Schindelin @ 2007-08-30  9:26 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Hi,

On Wed, 29 Aug 2007, Junio C Hamano wrote:

> Isn't this already in as 70f64148bf7ca5136f2aa18c41b3b8f4bebfd138
> (Fix t5701-clone-local for white space from wc)?

Argh.  I get confused with those new-workdirs.  (And it was necessary 
for 4msysgit, which lags behind again...)  Sorry for the noise.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-08-30  9:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-29 16:52 [PATCH] t5701: "wc -l" may add whitespace Johannes Schindelin
2007-08-29 16:55 ` Matthieu Moy
2007-08-29 17:00   ` Johannes Schindelin
2007-08-30  6:13 ` Junio C Hamano
2007-08-30  9:26   ` Johannes Schindelin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).