Subject: Re: [PATCH v7 6/9] submodule: fix detection of invalid submodule URL

From: Johannes Sixt <[email-masked]>
Date: Mon, 28 May 2012 21:01:18 +0200

Am 27.05.2012 17:34, schrieb Jon Seymour:
> diff --git a/git-submodule.sh b/git-submodule.sh
> index dbbc905..2550681 100755
> --- a/git-submodule.sh
> +++ b/git-submodule.sh
> @@ -37,23 +37,42 @@ resolve_relative_url ()
>  	remoteurl=$(git config "remote.$remote.url") ||
>  		remoteurl=$(pwd) # the repository is its own authoritative upstream
>  	url="$1"
> -	remoteurl=${remoteurl%/}
> -	sep=/
> +	remoteurl="${remoteurl%/}"
> +
> +	case "$remoteurl" in
> +		*//*/*)
> +			variant="${remoteurl#*//*/}"
> +		;;
> +		*::*)
> +			variant="${remoteurl#*::}"
> +		;;
> +		*:*)
> +			variant="${remoteurl#*:}"
> +		;;
> +		/*)
> +			variant="${remoteurl#/}"

Without understanding in detail what this series is about, I would guess
that the previous two case arms are not very Windows friendly. Does the
right thing happen when $remoteurl is "c:/path/to/remote"? Would it help
to use is_absolute_path?

	if is_absolute_path "$remoteurl"
	then
		variant="${remoteurl#*/}"
	else
		case "$remoteurl" in
		...other cases go here...
		esac
	fi

-- Hannes