fix(skills): work past the read-only git config #210
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/git-config-readonly"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
Claude Code keeps a repository's
.git/configread-only inside itssandbox, which the source's settings turn on, and no project setting
opens it. Since
adb02f0movedgit pushinside the sandbox, an agent'sfirst push of a branch lands without recording an upstream, and
deliverthen finds no remote for the branch's later folds. In afreshly adopted repository, the first worktree
open-worktreeopensfails on the same lock and leaves its branch behind, so the same command
run again outside the sandbox fails too. The README named neither case.
Set aside: dropping
-u, which loses the upstream outside the sandboxas well; and excluding the push or the worktree command from the
sandbox, which gives each full access and a prompt again.
What changed
A fold of a pushed branch now goes to the remote its remote-tracking ref
names, which the sandbox lets the push write. The first push keeps
-u,and
deliversays to go on after its upstream error. When severalremotes hold the branch, the agent asks which.
A repository's first worktree that fails on the config's lock is run
again outside the sandbox, a change's on the branch the failed attempt
left. This happens once in a repository and may prompt once.
The README names writes to
.git/configand.git/hooksamong whatfalls to a retry outside the sandbox, with the two messages git prints
and the way on for an unrecorded upstream and for the section a deleted
branch leaves.
How to verify
bash tests/agent-config/real-source.sh: all 6 tests pass. Withthe same file copied over
main's, the two new tests fail, the firstwith
git config branch.<branch>.remote names ''and the second withthe worktree on
''.branch with
git push -u origin <branch>: it exits 0 aftererror: unable to write upstream branch configuration. Thengit for-each-ref --format='%(refname:lstrip=2)' 'refs/remotes/*/<branch>'prints
origin/<branch>. This branch's own push went that way.Checks run on the tip:
bash tests/verify-agent-config.sh, with all 245tests passing,
.agents/hooks/shellcheck.sh repo,prettier --check '**/*.md',scripts/verify-agent-config.sh, andgit diff --check main. Not tried: a first worktree in a real sandboxedsession, since this source already holds the setting it writes, so the
tests simulate the lock with a
.git/config.lock; and macOS.Considerations
Two low findings of the documentation review's second round are set
aside, as later-round low findings are: the README gives the worktree's
retry as "without
-b" and leaves the start point toopen-worktree,and its retry paragraph grew denser.