From 02b35218d9aadcaa6a3b52f218b71577ab72c811 Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Sat, 14 Mar 2026 07:24:10 +0000 Subject: fix: trust all directory owners in sandbox git commands Sandbox setup runs git commands against project_dir which may be owned by a different OS user, triggering git's 'dubious ownership' error. Fix by passing -c safe.directory=* on all git commands that touch project directories. Also add wildcard to global config for immediate effect on the running server. Co-Authored-By: Claude Sonnet 4.6 --- internal/executor/claude_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'internal/executor/claude_test.go') diff --git a/internal/executor/claude_test.go b/internal/executor/claude_test.go index 36affef..7ab0802 100644 --- a/internal/executor/claude_test.go +++ b/internal/executor/claude_test.go @@ -620,3 +620,16 @@ func TestIsCompletionReport(t *testing.T) { }) } } + +func TestGitSafe_PrependsSafeDirectory(t *testing.T) { + got := gitSafe("-C", "/some/path", "status") + want := []string{"-c", "safe.directory=*", "-C", "/some/path", "status"} + if len(got) != len(want) { + t.Fatalf("gitSafe() = %v, want %v", got, want) + } + for i := range want { + if got[i] != want[i] { + t.Errorf("gitSafe()[%d] = %q, want %q", i, got[i], want[i]) + } + } +} -- cgit v1.2.3