Skip to content

fix(worktrees): keep WSL login banners out of removal checks - #35122

Closed
OrcaWin wants to merge 1 commit into
mainfrom
OrcaWin/git-removal-preflight-login-output
Closed

OrcaWin wants to merge 1 commit into
mainfrom
OrcaWin/git-removal-preflight-login-output

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​198 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​198
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2

ELI5

Space bulk deletion can refuse a clean WSL workspace because the shell prints its startup message before Git runs. A dirty workspace containing a submodule can also lose the warning that Force Delete destroys work inside that submodule.

What Changed

Request the runner's existing captured-output mode for the removal preflight's status/index reads and its .gitmodules read. Only Git stdout reaches the existing parsers. Clean workspaces and configured shared links pass; actual edits still refuse deletion, with the specialized submodule warning retained.

This affects the non-force local registered-worktree preflight reached by Space's bulk-delete action. Ordinary sidebar confirmation already sets force and bypasses this check.

Why

A required WSL login shell can print a normal banner such as To run a command as administrator, use sudo.. Treating that text as status makes an empty clean result look dirty. Prefixing the .gitmodules config record also changes its parsed path, so the populated submodule is missed. Use the established capture boundary instead of filtering arbitrary user output.

Linked Issue

Found during the Git workflow audit; no existing linked issue.

Visual Proof

Production failure toast using actual before/after preflight results for a dirty populated submodule. Before offers the ordinary changed-files message; after warns about commits, local branches and stashes that were never pushed. These are headless component fixtures, not a full Electron deletion run.

Before After
Before: ordinary dirty-file warning After: populated-submodule warning

Testing

  • Exact regression suite: original source fails four cases with five controls passing; fixed passes all nine. Focused removal, WSL runner and force-classification suites: 45 passed, four native-Windows tests skipped. New regression plus existing captured-output suite: 13 passed with actual Git 2.25.5.
  • Actual generated-shell proof: 60 cases across Git 2.25.5/2.55.0, baseline/status-only-captured/both-captured, banner/no-banner, clean/shared-symlink/dirty/force/populated-submodule workflows. Only the Windows subprocess transport is substituted; each shell verifies the selected Git version immediately before execution. Parent/child file bytes, index and HEAD remain unchanged; no deletion is performed. Capturing only status still loses the submodule warning.
  • Node typechecking, direct oxlint and formatting pass. Required pinned ORCA_BACKGROUND_LAUNCH=1 pnpm check:changed --base=2d3e7e452000c26433650d75422e79a06be80684 --maxWorkers=2 completed 19/20 checks; all non-unit checks pass. Its broad affected-test selection was stopped at 600.4 seconds under the authorized ten-minute bound without a final test summary, so the aggregate is not green. The controller finished in 604.1 seconds and verified all four owned subprocesses exited; the passing focused results above remain separate evidence.
  • Four production-toast screenshots pass DOM/content assertions without renderer errors. No native Windows/WSL/macOS, live SSH, physical mobile or full Electron run was performed. Checked-in tests use actual Git payloads through a controlled WSL transport; the external matrix executes the actual generated shell.

Review

Source and evidence reviewed independently before publication.

Agent skill upstream boundary

  • Not applicable; no skill-installer source is copied or translated.

Notes

No wire, client, provider or path conventions change. Other platforms retain their native command path; force still returns before Git reads. Folder removal does not use this Git-worktree preflight. Execution hosts must update their own removal implementation; this does not change remote runtime removal policy.

Actual open patches #17173 (failed Windows deletion), #33531 (local Git runtime routing), and #22163 (automation reclamation) were inspected; none captures these parsed reads.

@OrcaWin

OrcaWin commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator Author

Folded into #35053's runner-level default, which covers the removal preflight's status and ls-files reads. This branch conflicts with main: #35458 removed hasPopulatedSubmodule, so its second hunk targets code that no longer exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant