# [PATCH] Test failure when spaces in git root

2 messages from 2011-03-24 to 2011-03-24. Participants: Carl Michael Skog, Thomas Rast.
Thread: https://gitlist.dev/t/26846

## Carl Michael Skog, 2011-03-24 00:11

Subject: [PATCH] Test failure when spaces in git root
Message-ID: <1300925506-20378-1-git-send-email-cmskog@gmail.com>
URL: https://gitlist.dev/e/1300925506-20378-1-git-send-email-cmskog%40gmail.com

```
Some of the svn related tests would break when the git root path had
spaces in it.

The test checks in t/t9119-git-svn-info.sh where falsely assuming that
the only space where in the path of the generated subversion repository.
This will break when the actual git build repository has spaces in it.
Add a global modifier to the sed command that generates the expected
value for the tests.

Signed-off-by: Carl Michael Skog <cmskog@gmail.com>
---
 t/t9119-git-svn-info.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/t/t9119-git-svn-info.sh b/t/t9119-git-svn-info.sh
index ff19695..752bf26 100755
--- a/t/t9119-git-svn-info.sh
+++ b/t/t9119-git-svn-info.sh
@@ -28,7 +28,7 @@ test_cmp_info () {
 	rm -f tmp.expect tmp.actual
 }
 
-quoted_svnrepo="$(echo $svnrepo | sed 's/ /%20/')"
+quoted_svnrepo="$(echo $svnrepo | sed 's/ /%20/g')"
 
 test_expect_success 'setup repository and import' '
 	mkdir info &&
-- 
1.7.4.1.99.g3d9132

```

## Thomas Rast, 2011-03-24 20:46

Subject: Re: [PATCH] Test failure when spaces in git root
Message-ID: <201103242146.02728.trast@student.ethz.ch>
URL: https://gitlist.dev/e/201103242146.02728.trast%40student.ethz.ch
In-Reply-To: <1300925506-20378-1-git-send-email-cmskog@gmail.com>

```
Carl Michael Skog wrote:
> Some of the svn related tests would break when the git root path had
> spaces in it.
[...]
> -quoted_svnrepo="$(echo $svnrepo | sed 's/ /%20/')"
> +quoted_svnrepo="$(echo $svnrepo | sed 's/ /%20/g')"

If you're already fixing this, shouldn't it be

  $(echo "$svnrepo" | ...)

to stop the expansion process from converting arbitrary series of
whitespace into a single space?

However, any other (than space) character that needs %-quoting would
probably also break the test.  Maybe some more complicated mangling
would be in order.

-- 
Thomas Rast
trast@{inf,student}.ethz.ch

```
