git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] clone: local URLs are not for ssh

From
Torsten Bögershausen <tboegi@web.de>
Date
Sep 28, 2013, 19:37 UTC
Message-ID
<201309282137.21802.tboegi@web.de>

"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
Next: Duy Nguyen
Message 1 of 10 in “clone: local URLs are not for ssh”
  1. clone: local URLs are not for sshTorsten Bögershausen, Sep 28, 2013
  2. Duy NguyenSep 29, 2013
  3. Torsten BögershausenOct 2, 2013
  4. Duy NguyenOct 3, 2013
  5. Jeff KingOct 3, 2013
  6. Torsten BögershausenOct 5, 2013
  7. Matthieu MoyOct 5, 2013
  8. Torsten BögershausenOct 13, 2013
  9. Jeff KingOct 15, 2013
  10. Torsten BögershausenOct 15, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.