From 3adb46b7e1225e8f339d248f0ef9c32e34b20d9d Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Mon, 17 Feb 2025 11:59:09 +0800 Subject: *_handle_*_pack.go: Pass env LINDENII_FORGE_HOOKS_SOCKET_PATH --- http_handle_repo_upload_pack.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'http_handle_repo_upload_pack.go') diff --git a/http_handle_repo_upload_pack.go b/http_handle_repo_upload_pack.go index 4b75910..a19b081 100644 --- a/http_handle_repo_upload_pack.go +++ b/http_handle_repo_upload_pack.go @@ -3,6 +3,7 @@ package main import ( "io" "net/http" + "os" "os/exec" ) @@ -20,6 +21,7 @@ func handle_upload_pack(w http.ResponseWriter, r *http.Request, params map[strin w.WriteHeader(http.StatusOK) cmd := exec.Command("git", "upload-pack", "--stateless-rpc", repo_path) + cmd.Env = append(os.Environ(), "LINDENII_FORGE_HOOKS_SOCKET_PATH="+config.Hooks.Socket) stdout, err := cmd.StdoutPipe() if err != nil { return err -- cgit v1.2.3