From 71ab9b7f14118f02dd18cd733bd4e0ad19ece590 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sat, 5 Apr 2025 20:21:32 +0800 Subject: config shall no longer be a global variable --- ssh_handle_upload_pack.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ssh_handle_upload_pack.go') diff --git a/ssh_handle_upload_pack.go b/ssh_handle_upload_pack.go index d732a72..7f2a52c 100644 --- a/ssh_handle_upload_pack.go +++ b/ssh_handle_upload_pack.go @@ -13,14 +13,14 @@ import ( // sshHandleUploadPack handles clones/fetches. It just uses git-upload-pack // and has no ACL checks. -func sshHandleUploadPack(session glider_ssh.Session, pubkey, repoIdentifier string) (err error) { +func (s *server) sshHandleUploadPack(session glider_ssh.Session, pubkey, repoIdentifier string) (err error) { var repoPath string - if _, _, _, repoPath, _, _, _, _, err = getRepoInfo2(session.Context(), repoIdentifier, pubkey); err != nil { + if _, _, _, repoPath, _, _, _, _, err = s.getRepoInfo2(session.Context(), repoIdentifier, pubkey); err != nil { return err } proc := exec.CommandContext(session.Context(), "git-upload-pack", repoPath) - proc.Env = append(os.Environ(), "LINDENII_FORGE_HOOKS_SOCKET_PATH="+config.Hooks.Socket) + proc.Env = append(os.Environ(), "LINDENII_FORGE_HOOKS_SOCKET_PATH="+s.config.Hooks.Socket) proc.Stdin = session proc.Stdout = session proc.Stderr = session.Stderr() -- cgit v1.2.3