git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Sixt <j.sixt@viscovery.net>
To: "Torsten Bögershausen" <tboegi@web.de>, git@vger.kernel.org
Cc: sunshine@sunshineco.com, peff@peff.net, pclouds@gmail.com
Subject: Re: [PATCH V3] git clone: is an URL local or ssh
Date: Wed, 30 Oct 2013 08:11:49 +0100	[thread overview]
Message-ID: <5270B135.8030501@viscovery.net> (raw)
In-Reply-To: <201310292207.50869.tboegi@web.de>

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

      parent reply	other threads:[~2013-10-30  7:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-29 21:07 [PATCH V3] git clone: is an URL local or ssh Torsten Bögershausen
2013-10-30  6:42 ` Jeff King
2013-10-30  6:52 ` Johannes Sixt
2013-10-30  7:11 ` Johannes Sixt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5270B135.8030501@viscovery.net \
    --to=j.sixt@viscovery.net \
    --cc=git@vger.kernel.org \
    --cc=pclouds@gmail.com \
    --cc=peff@peff.net \
    --cc=sunshine@sunshineco.com \
    --cc=tboegi@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).