All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Torsten Bögershausen" <tboegi@web.de>
To: git@vger.kernel.org
Cc: pclouds@gmail.com
Subject: [PATCH] clone: local URLs are not for ssh
Date: Sat, 28 Sep 2013 21:37:21 +0200	[thread overview]
Message-ID: <201309282137.21802.tboegi@web.de> (raw)

"git clone /foo/bar:baz" or "git clone ../foo/bar:baz"
are meant to clone from the local file system, and not to clone
from a remote server over git-over-ssh.

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
---
 connect.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/connect.c b/connect.c
index a80ebd3..b382032 100644
--- a/connect.c
+++ b/connect.c
@@ -550,7 +550,8 @@ struct child_process *git_connect(int fd[2], const char *url_orig,
 		end = host;
 
 	path = strchr(end, c);
-	if (path && !has_dos_drive_prefix(end)) {
+	if (path && !has_dos_drive_prefix(end) &&
+	    url[0] != '/' && url[0] != '.' ) {
 		if (c == ':') {
 			if (path < strchrnul(host, '/')) {
 				protocol = PROTO_SSH;
-- 
1.8.4.457.g424cb08

             reply	other threads:[~2013-09-28 19:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-28 19:37 Torsten Bögershausen [this message]
2013-09-29  0:33 ` [PATCH] clone: local URLs are not for ssh Duy Nguyen
2013-10-02 18:40   ` Torsten Bögershausen
2013-10-03  1:01     ` Duy Nguyen
2013-10-03  1:31       ` Jeff King
2013-10-05 19:48         ` Torsten Bögershausen
2013-10-05 20:35           ` Matthieu Moy
2013-10-13 20:00           ` Torsten Bögershausen
2013-10-15  0:12             ` Jeff King
2013-10-15  7:22               ` Torsten Bögershausen

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=201309282137.21802.tboegi@web.de \
    --to=tboegi@web.de \
    --cc=git@vger.kernel.org \
    --cc=pclouds@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.