aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Verdoolaege <skimo@liacs.nl>2005-06-14 12:37:38 +0200
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-14 12:09:34 -0700
commit479346adc5ebb099121063d4c06da30093ed9b3b (patch)
treef8694ce5a8204f71fdb0d9d2eb1a18cd5f1aa38f
parent7737314de711aa3a2e4201355777cd41fb791c98 (diff)
downloadgit-479346adc5ebb099121063d4c06da30093ed9b3b.tar.gz
git-479346adc5ebb099121063d4c06da30093ed9b3b.tar.xz
[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 <skimo@liacs.nl> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--rsh.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/rsh.c b/rsh.c
index 8eea1d023..5615c74e7 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 <host> 'cd /<path>; stdio-pull <arg...> <commit-id>' */
+ /* ssh <host> 'cd <path>; stdio-pull <arg...> <commit-id>' */
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++) {