From: Sven Verdoolaege Date: Tue, 14 Jun 2005 10:37:38 +0000 (+0200) Subject: [PATCH] ssh-push: Don't add '/' to pathname X-Git-Tag: v0.99~263 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=479346adc5ebb099121063d4c06da30093ed9b3b;p=git.git [PATCH] ssh-push: Don't add '/' to pathname Paths in the host:path notation are usually interpreted relative to the login directory rather than relative to the root directory. Signed-off-by: Sven Verdoolaege Signed-off-by: Linus Torvalds --- diff --git a/rsh.c b/rsh.c index 8eea1d02..5615c74e 100644 --- a/rsh.c +++ b/rsh.c @@ -31,14 +31,15 @@ int setup_connection(int *fd_in, int *fd_out, const char *remote_prog, } else { host = url; path = strchr(host, ':'); + if (path) + *(path++) = '\0'; } if (!path) { return error("Bad URL: %s", url); } - *(path++) = '\0'; - /* ssh 'cd /; stdio-pull ' */ + /* ssh 'cd ; stdio-pull ' */ snprintf(command, COMMAND_SIZE, - "%s='/%s' %s", + "%s='%s' %s", GIT_DIR_ENVIRONMENT, path, remote_prog); posn = command + strlen(command); for (i = 0; i < rmt_argc; i++) {