Re: [PATCH 5/6 (v4)] full integration of rev-cache into git, completed test suite

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



(The Cc list of the parent message was truncated.
 The Cc list of this message was adopted from later messages.)

I needed something like the following to get the tests to pass.
If you like it, squash it into 5/6.

-->8--
Subject: [PATCH] t6017: use 'tr -d' to strip spaces from 'wc -c' output

The previous use of 'grep -o "[0-9]*"' was producing an empty string
(GNU grep 2.5.1 on Mac OS X 10.4.11). Additionally, since 'wc' echos
its filename arguments when stdin is not the source, the 'grep -o'
might have also extracted additional decimal strings embedded in the
filename (a SHA-1 hash value).

This 'tr -d' style is used in git-filter-branch.sh, and t6003.
Another alternative (in t1006) is to use 'sed' to strip off the
leading spaces.

Signed-off-by: Chris Johnsen <chris_johnsen@xxxxxxxxx>
---
 t/t6017-rev-cache-list.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/t/t6017-rev-cache-list.sh b/t/t6017-rev-cache-list.sh
index 6ada7ac..3f49cb3 100755
--- a/t/t6017-rev-cache-list.sh
+++ b/t/t6017-rev-cache-list.sh
@@ -246,7 +246,7 @@ test_expect_success 'make fragmented slices' '
 	test `grep "final return value: 0" output.err | wc -l` -eq 3
 '
 
-cache_size=`wc -c .git/rev-cache/$cache_sha1 | grep -o "[0-9]*"`
+cache_size=`wc -c < .git/rev-cache/$cache_sha1 | tr -d ' '`
 test_expect_success 'test --ignore-size function in fuse' '
 	git-rev-cache fuse --ignore-size=$cache_size 2>output.err &&
 	grep "final return value: 0" output.err &&
-- 
1.6.5.rc1.183.g23fa6

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]