{"thread":{"id":"934","subject":"[PATCH] ssh-push: Don't add '/' to pathname","startedAt":"2005-06-14T10:37:38Z","lastAt":"2005-06-17T08:13:18Z","messageCount":2,"participants":["Sven Verdoolaege"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"4942","messageId":"20050614103738.GA14483@pc117b.liacs.nl","threadId":"934","inReplyTo":null,"subject":"[PATCH] ssh-push: Don't add '/' to pathname","fromName":"Sven Verdoolaege","fromEmail":"skimo@liacs.nl","sentAt":"2005-06-14T10:37:38Z","receivedAt":"2005-06-14T10:37:38Z","isPatch":true,"sender":{"key":"skimo@kotnet.org","avatar":null},"body":"ssh-push: Don't add '/' to pathname\n\nPaths in the host:path notation are usually interpreted\nrelative to the login directory rather than relative to\nthe root directory.\n\nSigned-off-by: Sven Verdoolaege <skimo@liacs.nl>\n\n---\ncommit 508f3a7ad9d940529ad6736763108fe5c7729171\ntree 7332f4cd8f29f0548821f1d0501b2e9a45ae502a\nparent 200b82de27633d2c85a4358e1be5ae7fab1b077f\nauthor Sven Verdoolaege <skimo@liacs.nl> Tue, 14 Jun 2005 12:34:49 +0200\ncommitter Sven Verdoolaege <skimo@liacs.nl> Tue, 14 Jun 2005 12:34:49 +0200\n\n rsh.c |    7 ++++---\n 1 files changed, 4 insertions(+), 3 deletions(-)\n\ndiff --git a/rsh.c b/rsh.c\n--- a/rsh.c\n+++ b/rsh.c\n@@ -31,14 +31,15 @@ int setup_connection(int *fd_in, int *fd\n \t} else {\n \t\thost = url;\n \t\tpath = strchr(host, ':');\n+\t\tif (path)\n+\t\t\t*(path++) = '\\0';\n \t}\n \tif (!path) {\n \t\treturn error(\"Bad URL: %s\", url);\n \t}\n-\t*(path++) = '\\0';\n-\t/* ssh <host> 'cd /<path>; stdio-pull <arg...> <commit-id>' */\n+\t/* ssh <host> 'cd <path>; stdio-pull <arg...> <commit-id>' */\n \tsnprintf(command, COMMAND_SIZE, \n-\t\t \"%s='/%s' %s\",\n+\t\t \"%s='%s' %s\",\n \t\t GIT_DIR_ENVIRONMENT, path, remote_prog);\n \tposn = command + strlen(command);\n \tfor (i = 0; i < rmt_argc; i++) {\n"},{"id":"5000","messageId":"20050617081318.GA23688@pc117b.liacs.nl","threadId":"934","inReplyTo":"20050614103738.GA14483@pc117b.liacs.nl","subject":"Re: [PATCH] ssh-push: Don't add '/' to pathname","fromName":"Sven Verdoolaege","fromEmail":"skimo@liacs.nl","sentAt":"2005-06-17T08:13:18Z","receivedAt":"2005-06-17T08:13:18Z","isPatch":true,"sender":{"key":"skimo@kotnet.org","avatar":null},"body":"Ok, I'm stupid.\n\nThis patch has actually been tested.\n\nskimo\n\n--\nssh-push.c: Fix handling of ssh://host/path URLs\n\nPrevious patch to fix host:path notation broke\nhandling of ssh://host/path notation.\n\nSigned-off-by: Sven Verdoolaege <skimo@liacs.nl>\n\n---\ncommit 4fd62062eb2d52d32cb771feb05bf1ee29d760f9\ntree 75ea11a1b6bf7ca17a274b3a8ce2191e7b815e87\nparent 7875b50d1a9928e683299b283bfe94778b6c344e\nauthor Sven Verdoolaege <skimo@liacs.nl> Fri, 17 Jun 2005 10:08:27 +0200\ncommitter Sven Verdoolaege <skimo@liacs.nl> Fri, 17 Jun 2005 10:08:27 +0200\n\n rsh.c |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/rsh.c b/rsh.c\n--- a/rsh.c\n+++ b/rsh.c\n@@ -41,6 +41,7 @@ int setup_connection(int *fd_in, int *fd\n \tsnprintf(command, COMMAND_SIZE, \n \t\t \"%s='%s' %s\",\n \t\t GIT_DIR_ENVIRONMENT, path, remote_prog);\n+\t*path = '\\0';\n \tposn = command + strlen(command);\n \tfor (i = 0; i < rmt_argc; i++) {\n \t\t*(posn++) = ' ';\n"}]}