Repository navigation
Conversation
safe.directory matches exact paths, so worktrees under /workspace/.claude/worktrees/* failed with "detected dubious ownership" whenever the bind-mount ownership mismatch (#172) was active. Add '/workspace/*' to /etc/gitconfig next to /workspace: since git 2.46 a trailing /* trusts every repository under the leading path (the image has 2.47.3), but not the directory itself, so both entries are needed. '/workspace/*' rather than '*' keeps the check for paths outside the bind mount. verify-image.sh asserts the new entry. Closes #253
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Trust git worktrees and nested repositories under
/workspacein the claude-code image, not just/workspaceitself.Why
safe.directorymatches exact paths. The image trusts only/workspace, so a worktree at/workspace/.claude/worktrees/<name>(Claude Code's default location) fails withdetected dubious ownershipwhenever the bind-mount ownership mismatch from #172 is active. That includes Hugo'senableGitInfogit calls, which can't take a-coverride (#211). It also includes Claude Code's own--worktreeand subagent-isolation checks, which refuse a worktree git can't read.Changes
claude-code/.devcontainer/Dockerfile: addsafe.directory '/workspace/*'to/etc/gitconfignext to the existing/workspaceentry, in thebasestage, so both variants get it.claude-code/verify-image.sh: assert the new entry.claude-code/README.md(Git and GitHub Authentication): describe the second entry, and say that the Dev Containers extension adds only a/workspaceentry.Notes
/*trusts every repository under that leading path, but not the directory itself (Documentation/config/safe.txtdocuments this from v2.46.0 on, not in v2.45.0). The image ships git 2.47.3. I checked this in the publishedclaude-code:latestimage with a root-owned/workspace, a realgit worktree add .claude/worktrees/x, and a nested repo, running git asnode:/workspace, the worktree fails withdubious ownership.*:/workspace/*keeps the check for paths outside the bind mount. Everything under/workspaceis the user's own repo, which the agent can already write, so this adds no new write path.safe.directory(bun, claude-bun, hugo-bun, hugo-bun-node, ralphex-fe, the repo's own.devcontainer), so nothing else needs this fix.containerEnvcomments in bothdevcontainer.jsonfiles still say "the image trusts /workspace". They're accurate, and feat(claude-code): turn off claude.ai connectors in both variants #313 and feat(claude-code): give the GitHub MCP server the gh login's token #316 edit the same block.safe.directory, gitconfig, or worktrees.Closes #253