diff options
author | Runxi Yu <me@runxiyu.org> | 2025-02-12 19:16:41 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-02-12 19:16:41 +0800 |
commit | f828acac387aacadd2884837402b0e32b2368470 (patch) | |
tree | 475c374f5e9b1205136cf03171867ead7fad4291 /ssh.go | |
parent | http_router.go: Move from router.go and fix conditional placement bug (diff) | |
download | forge-f828acac387aacadd2884837402b0e32b2368470.tar.gz forge-f828acac387aacadd2884837402b0e32b2368470.tar.zst forge-f828acac387aacadd2884837402b0e32b2368470.zip |
*.go: Use the database for repo info, and fix ssh cloning repo
Diffstat (limited to '')
-rw-r--r-- | ssh.go | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -43,12 +43,18 @@ func serve_ssh() error { return } - proc := exec.CommandContext(session.Context(), cmd[0], "/home/runxiyu/git/forge.git") + fs_path, err := get_repo_path_from_ssh_path(session.Context(), cmd[1]) + if err != nil { + fmt.Fprintln(session.Stderr(), "Error while getting repo path:", err) + return + } + + proc := exec.CommandContext(session.Context(), cmd[0], fs_path) proc.Stdin = session proc.Stdout = session proc.Stderr = session.Stderr() - err := proc.Start() + err = proc.Start() if err != nil { fmt.Fprintln(session.Stderr(), "Error while starting process:", err) return |