diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-03-14 07:24:10 +0000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-03-14 07:24:10 +0000 |
| commit | 02b35218d9aadcaa6a3b52f218b71577ab72c811 (patch) | |
| tree | ffa761a07b940e97bf1e741b0cff8fcd74622a89 /internal/executor/claude_test.go | |
| parent | e0e81bbdaae37353803d47fa59a36d0472f8146d (diff) | |
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 <noreply@anthropic.com>
Diffstat (limited to 'internal/executor/claude_test.go')
| -rw-r--r-- | internal/executor/claude_test.go | 13 |
1 files changed, 13 insertions, 0 deletions
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]) + } + } +} |
