diff options
author | Runxi Yu <me@runxiyu.org> | 2025-02-17 11:59:09 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-02-17 11:59:09 +0800 |
commit | 3adb46b7e1225e8f339d248f0ef9c32e34b20d9d (patch) | |
tree | b5fa1e199338252e1784ba10a1a9e65b91e0d5c4 /http_handle_repo_upload_pack.go | |
parent | *.go: Reformat (diff) | |
download | forge-3adb46b7e1225e8f339d248f0ef9c32e34b20d9d.tar.gz forge-3adb46b7e1225e8f339d248f0ef9c32e34b20d9d.tar.zst forge-3adb46b7e1225e8f339d248f0ef9c32e34b20d9d.zip |
*_handle_*_pack.go: Pass env LINDENII_FORGE_HOOKS_SOCKET_PATH
Diffstat (limited to '')
-rw-r--r-- | http_handle_repo_upload_pack.go | 2 |
1 files changed, 2 insertions, 0 deletions
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 |