Repository navigation
fix: 🐛 Refuse sbx pull patches for what git runs and reads - #900
Conversation
Signed-off-by: Evaline Ju <[email protected]>
Signed-off-by: Evaline Ju <[email protected]>
Signed-off-by: Evaline Ju <[email protected]>
Signed-off-by: Evaline Ju <[email protected]>
67ae835 to
c92fe5c
Compare
pdettori
left a comment
There was a problem hiding this comment.
Summary
Sound change: pull --apply now refuses patches that write the core.hooksPath directory, a non-.git git directory, git config files (read, included, or global/XDG/system, even when missing), and anything inside a nested repo/submodule. I traced the --show-origin -z parsing, the symlink/dangling-link resolution, the git var exit-code handling and the case folding; no blocking issues. Failures to read git config fail closed. Tests cover refusals, sibling non-refusals, nested repos, pre-2.42 git and $HOME-as-tree. Two non-blocking suggestions and two nits inline.
Author: evaline-ju (MEMBER, maintainer)
Areas reviewed: TypeScript (mocactl), tests, docs/spec
Agent/IDE config (.claude/.vscode): none
Commits: 4 commits, all signed-off: yes (subjects use emoji prefixes rather than conventional ones, advisory only)
CI status: passing
Assisted-By: Claude Code
Signed-off-by: Evaline Ju <[email protected]>
|
thanks - need to resolve conflicts to merge |
Signed-off-by: Evaline Ju <[email protected]>
Brings rossoctl#900 (an sbx hook). No conflicts. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Rong Chang <[email protected]>
Summary
sbx pull --applynow refuses a patch that writes thecore.hooksPathdirectory, a git directory not named.git, or a git config file: read, included, or at git's global, XDG or system location, even before it exists. A sandbox can't use any of these to run code on the host at the next git command. Paths come from git itself and are resolved through symlinks, including dangling ones.Fixes #890 , replaces #891 with messier history
Assisted-By: Claude Code
Checklist
git commit -s).make lintand the tests for the touched packages pass.docs/page, with the right maturity label (seedocs/CONTRIBUTING-DOCS.md).make check-linkspasses if any Markdown changed.docs/specs/README.mdordocs/adrs/README.md. - N/A