Thread (9 messages) flat view 9 messages, 3 authors, 2016-06-15
STALE3750d

[PATCH] clone: local URLs are not for ssh

From: Torsten Bögershausen <hidden>
Date: 2016-06-15 22:58:55
Subsystem: the rest · Maintainer: Linus Torvalds

"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 <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help