提交 479346ad 编写于 作者: S Sven Verdoolaege 提交者: Linus Torvalds

[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: NSven Verdoolaege <skimo@liacs.nl>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 7737314d
......@@ -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++) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册