Subject: Re: [PATCH V2] git clone: is an URL local or ssh

From: Junio C Hamano <[email-masked]>
Date: Mon, 28 Oct 2013 13:57:13 -0700

Torsten Bögershausen <[email-masked]> writes:

> (This does apply on pu, not on master.

Hmph.  At least for me, it applies down to cabb411f (Merge branch
'nd/clone-local-with-colon', 2013-10-14) just fine.  Puzzled.

> diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
> index 1d1c875..a126f08 100755
> --- a/t/t5601-clone.sh
> +++ b/t/t5601-clone.sh
> @@ -294,39 +294,95 @@ test_expect_success 'setup ssh wrapper' '
>  	export TRASH_DIRECTORY
>  '
>  
> -clear_ssh () {
> -	>"$TRASH_DIRECTORY/ssh-output"
> -}
> -
> -expect_ssh () {
> +i5601=0
> +# $1 url
> +# $2 none|host
> +# $3 path
> +test_clone_url () {
> +	i5601=$(($i5601 + 1))
> +	>"$TRASH_DIRECTORY/ssh-output" &&
> +	test_might_fail git clone "$1" tmp$i5601 &&
>  	{
> -		case "$1" in
> +		case "$2" in
>  		none)
>  			;;
>  		*)
> -			echo "ssh: $1 git-upload-pack '$2'"
> +			echo "ssh: $2 git-upload-pack '$3'"
>  		esac
>  	} >"$TRASH_DIRECTORY/ssh-expect" &&

This looks like a strange use of {} (not an issue this patch
introduced, though).  Shouldn't this suffice?

	case ... in
        ...
        esac >"$TRASH_DIRECTORY/ssh-expect"

> +	(
> +		cd "$TRASH_DIRECTORY" &&
> +		test_cmp ssh-expect ssh-output &&
> +		rm -rf ssh-expect ssh-output

Drop "r", please, when you know these are supposed to be files.

> +	)
>  }
>  
> +# url looks ssh like, and is on disc: should be local
>  test_expect_success NOT_MINGW,NOT_CYGWIN 'clone local path foo:bar' '
>  	cp -R src "foo:bar" &&
> +	test_clone_url "foo:bar" none &&
> +	( cd tmp$i5601 && git log)

Hmph.  What is this "git log" about?  Leftover from an earlier
debugging session?

The code change to connect.c part seemed to be OK from a cursory
look.

Thanks.