# t5601-clone.sh failures

3 messages from 2016-05-09 to 2016-05-09. Participants: Armin Kunaschik, tboegi@web.de, Junio C Hamano.
Thread: https://gitlist.dev/t/42266

## Armin Kunaschik, 2016-05-09 17:10

Subject: t5601-clone.sh failures
Message-ID: <CALR6jEhTTo-6fgy3_TnGseXJr2OZM+cK+t4BCVEzpCZNfhn5Bg@mail.gmail.com>
URL: https://gitlist.dev/e/CALR6jEhTTo-6fgy3_TnGseXJr2OZM%2BcK%2Bt4BCVEzpCZNfhn5Bg%40mail.gmail.com

```
Hi list,

eight t5601 tests don't run with my version of sed.
The reason is a trailing space in the sed expression. See below:

#IPv6
for tuah in ::1 [::1] [::1]: user@::1 user@[::1] user@[::1]:
[user@::1] [user@::1]:
do
        ehost=$(echo $tuah | sed -e "s/1]:/1]/ "| tr -d "[]")
        test_expect_success "clone ssh://$tuah/home/user/repo" "
          test_clone_url ssh://$tuah/home/user/repo $ehost /home/user/repo
        "
done

I can not imagine a reason why there should be a space character...
The tests run fine here without the space.
When there isn't any reason, the trailing space should be removed.

Armin

```

## tboegi@web.de, 2016-05-09 17:53

Subject: [PATCH v1 1/1] t5601: Remove trailing space in sed expression
Message-ID: <1462816392-29561-1-git-send-email-tboegi@web.de>
URL: https://gitlist.dev/e/1462816392-29561-1-git-send-email-tboegi%40web.de
In-Reply-To: <CALR6jEhTTo-6fgy3_TnGseXJr2OZM+cK+t4BCVEzpCZNfhn5Bg@mail.gmail.com>

```
From: Torsten Bögershausen <tboegi@web.de>

The sed expression for IPv6, "Tested User And Host" or "tuah" used a wrong
sed expression, which doesn't work under all versions of sed.

Reported-By: Armin Kunaschik <megabreit@googlemail.com>
Signed-off-by: Torsten Bögershausen <tboegi@web.de>
---
 t/t5601-clone.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
index 150aeaf..a433394 100755
--- a/t/t5601-clone.sh
+++ b/t/t5601-clone.sh
@@ -466,7 +466,7 @@ test_expect_success 'clone ssh://host.xz:22/~repo' '
 #IPv6
 for tuah in ::1 [::1] [::1]: user@::1 user@[::1] user@[::1]: [user@::1] [user@::1]:
 do
-	ehost=$(echo $tuah | sed -e "s/1]:/1]/ "| tr -d "[]")
+	ehost=$(echo $tuah | sed -e "s/1]:/1]/" | tr -d "[]")
 	test_expect_success "clone ssh://$tuah/home/user/repo" "
 	  test_clone_url ssh://$tuah/home/user/repo $ehost /home/user/repo
 	"
-- 
2.0.0.rc1.6318.g0c2c796

```

## Junio C Hamano, 2016-05-09 18:38

Subject: Re: [PATCH v1 1/1] t5601: Remove trailing space in sed expression
Message-ID: <xmqqd1ovulev.fsf@gitster.mtv.corp.google.com>
URL: https://gitlist.dev/e/xmqqd1ovulev.fsf%40gitster.mtv.corp.google.com
In-Reply-To: <1462816392-29561-1-git-send-email-tboegi@web.de>

```
tboegi@web.de writes:

> From: Torsten Bögershausen <tboegi@web.de>
>
> The sed expression for IPv6, "Tested User And Host" or "tuah" used a wrong
> sed expression, which doesn't work under all versions of sed.
>
> Reported-By: Armin Kunaschik <megabreit@googlemail.com>
> Signed-off-by: Torsten Bögershausen <tboegi@web.de>
> ---

Good.  Thanks.

>  t/t5601-clone.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
> index 150aeaf..a433394 100755
> --- a/t/t5601-clone.sh
> +++ b/t/t5601-clone.sh
> @@ -466,7 +466,7 @@ test_expect_success 'clone ssh://host.xz:22/~repo' '
>  #IPv6
>  for tuah in ::1 [::1] [::1]: user@::1 user@[::1] user@[::1]: [user@::1] [user@::1]:
>  do
> -	ehost=$(echo $tuah | sed -e "s/1]:/1]/ "| tr -d "[]")
> +	ehost=$(echo $tuah | sed -e "s/1]:/1]/" | tr -d "[]")
>  	test_expect_success "clone ssh://$tuah/home/user/repo" "
>  	  test_clone_url ssh://$tuah/home/user/repo $ehost /home/user/repo
>  	"

```
