[prev in list] [next in list] [prev in thread] [next in thread] 

List:       git
Subject:    Re: [PATCH V3] git clone: is an URL local or ssh
From:       Johannes Sixt <j.sixt () viscovery ! net>
Date:       2013-10-30 7:11:49
Message-ID: 5270B135.8030501 () viscovery ! net
[Download RAW message or body]

Am 10/29/2013 22:07, schrieb Torsten Bögershausen:
> @@ -610,17 +623,17 @@ struct child_process *git_connect(int fd[2], const char *url_orig,
>  	} else
>  		end = host;
>  
> -	path = strchr(end, c);
> -	if (path && !has_dos_drive_prefix(end)) {
> -		if (c == ':') {
> -			if (host != url || path < strchrnul(host, '/')) {
> -				protocol = PROTO_SSH;
> -				*path++ = '\0';
> -			} else /* '/' in the host part, assume local path */
> -				path = end;
> +	path = strchr(end, separator);
> +	if (separator == ':') {
> +		if (path && protocol == PROTO_LOCAL_OR_SSH) {
> +			/* We have a ':' */
> +			protocol = PROTO_SSH;
> +			*path++ = '\0';
> +		} else {/* assume local path */
> +			protocol = PROTO_LOCAL;
> +			path = end;
>  		}
> -	} else
> -		path = end;
> +	}
>  
>  	if (!path || !*path)
>  		die("No path specified. See 'man git-pull' for valid url syntax");

This hunk breaks on Windows. You removed the has_dos_drive_prefix check.

The check for has_dos_drive_prefix check must happen *before* you further
investigate the path/url/host for ssh protocol, and if it returns true,
then the path is local, no matter what follows.

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

Configure | About | News | Add a list | Sponsored by KoreLogic