From f828acac387aacadd2884837402b0e32b2368470 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Wed, 12 Feb 2025 19:16:41 +0800 Subject: *.go: Use the database for repo info, and fix ssh cloning repo --- ssh.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'ssh.go') diff --git a/ssh.go b/ssh.go index e1b9ff1..4d49fc9 100644 --- a/ssh.go +++ b/ssh.go @@ -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 -- cgit v1.2.3