Repository navigation
Conversation
9bbadb0 to
0404ae7
Compare
This comment was marked as low quality.
This comment was marked as low quality.
|
Codex review: needs maintainer review before merge. Summary Reproducibility: yes. for the root cause: current main passes refs to Real behavior proof Next step before merge Security Review detailsBest possible solution: Land this focused installer fix after normal validation, then let the linked issue at #79898 close as implemented. Do we have a high-confidence way to reproduce the issue? Yes for the root cause: current main passes refs to Is this the best way to solve the issue? Yes; switching this single argv boundary to What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 4cfcc32ee315. |
|
Thanks @afurm. I landed this on The landed change keeps the fix focused on the git plugin installer argv boundary: explicit refs now use Credit is preserved in the changelog for @afurm and @vincentkoc, and this will be included in the next release. Verification:
No dependency pins, package manifests, lockfiles, workflow matrix, or release-branch backports were changed. |
Summary
git:plugin installs passed explicit refs togit checkout --detach <ref>, letting option-like values be parsed as checkout flags.--ignore-skip-worktree-bitscan return success from Git and leave the clone on the default branch, weakening the installer's ref-pinning semantics.git switch --detach -- <ref>so the requested value is interpreted as a ref and rejected when invalid.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Real behavior proof (required for external PRs)
git:plugin installs should fail invalid option-like refs instead of allowing Git to treat them as checkout flags and continue on the default branch.pnpmworkspace install with a temporaryOPENCLAW_HOMEand temporary local git plugin repository.OPENCLAW_HOME="$tmp/openclaw-home" pnpm openclaw plugins install "git:file://$tmp/plugin-repo@--ignore-skip-worktree-bits"pnpm check:changed; the lane selector included core/coreTests, and no Testbox runner was available locally.Root Cause (if applicable)
git checkout --detach, so Git parsed leading-dash values as checkout options.Regression Test Plan (if applicable)
src/plugins/git-install.test.ts--togit switch --detachand do not reach plugin package install when checkout fails.User-visible / Behavior Changes
Invalid option-like git plugin refs now fail checkout instead of potentially installing the repository default branch.
Diagram (if applicable)
N/A
Security Impact (required)
Yes/No): NoYes/No): NoYes/No): NoYes/No): YesYes/No): NoYes, explain risk + mitigation: the Git checkout command changes fromcheckout --detach <ref>toswitch --detach -- <ref>so the command treats the supplied value as a ref instead of an option.Repro + Verification
Environment
OPENCLAW_HOMESteps
OPENCLAW_HOME="$tmp/openclaw-home" pnpm openclaw plugins install "git:file://$tmp/plugin-repo@--ignore-skip-worktree-bits".pnpm test src/plugins/git-install.test.ts.Expected
Actual
fatal: invalid reference: --ignore-skip-worktree-bitsand exits1.Evidence
Human Verification (required)
What you personally verified (not just CI), and how:
Review Conversations
Compatibility / Migration
Yes/No): YesYes/No): NoYes/No): NoRisks and Mitigations
git switch.git switchhas been available since Git 2.23 and is supported by current Git for Windows/macOS/Linux distributions.