From e24f63b60bd086c3875d89d24709d35e93eb641f Mon Sep 17 00:00:00 2001 From: Seongmin Lee Date: Fri, 26 Jun 2026 01:52:18 +0900 Subject: [PATCH] knotserver/sandbox: pass HOME env on NoopBackend Signed-off-by: Seongmin Lee --- knotserver/sandbox/sandbox.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/knotserver/sandbox/sandbox.go b/knotserver/sandbox/sandbox.go index a7640d44..a4193021 100644 --- a/knotserver/sandbox/sandbox.go +++ b/knotserver/sandbox/sandbox.go @@ -1,6 +1,10 @@ package sandbox -import "os/exec" +import ( + "fmt" + "os" + "os/exec" +) // Backend wraps git subprocesses in a filesystem sandbox. type Backend interface { @@ -13,6 +17,7 @@ type Backend interface { type NoopBackend struct{} func (n *NoopBackend) Wrap(repoPath string, cmd *exec.Cmd) (*exec.Cmd, error) { + cmd.Env = append(cmd.Env, fmt.Sprintf("HOME=%s", os.Getenv("HOME"))) cmd.Dir = repoPath return cmd, nil } -- 2.51.2