Skip to content

fix(server): treat a missing git binary as no repository - #10376

Closed
realbakari wants to merge 1 commit into
pingdotgg:mainfrom
realbakari:fix/vcs-missing-git-spawn
Closed

realbakari wants to merge 1 commit into
pingdotgg:mainfrom
realbakari:fix/vcs-missing-git-spawn

Conversation

@realbakari

Copy link
Copy Markdown
Contributor

What Changed

GitVcsDriver.isInsideWorkTree now treats a missing git executable as “not a repository” instead of failing.

A VcsProcessSpawnError whose cause is PlatformError NotFound on ChildProcess.spawn (and not chdir) maps to false. detectRepository already returns null when that probe is false, so folder-open VCS detect no longer toasts. A missing working directory still fails.

Why

#10351: opening a folder without Git on PATH showed VCS process failed to spawn… git. Exit 128 (“not a repo”) was already silent. A missing binary was not.

Settings → Version Control already reports Git as unavailable via git --version. That switch is an availability indicator, not an off switch, and detect did not use it. Same missing-binary handling as gh / az.

Fixes #10351

UI Changes

None. The spawn toast on folder open goes away when Git is not installed. No copy or layout change.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes (not applicable)

Grok 4.6 (Grok Build)

Folder open spawned git rev-parse and toasted VcsProcessSpawnError when
git was not on PATH. Settings already showed Git as unavailable; detect
did not use that result.

Map the missing-executable spawn (ChildProcess NotFound, not chdir) to
false/null, matching other CLI unavailable handling. Confirmed missing
directories still fail.

Fixes pingdotgg#10351

Grok 4.6 (Grok Build)
@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Sep 6, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Would Approve

Macroscope's review found this PR approvable — This focused fix changes only repository detection so an unavailable Git executable is treated as no repository, while preserving errors for missing working directories and other operations. The production change is small and accompanied by targeted regression tests.

Not approved because:

  • Monthly spending limit reached (workspace setting). Approvability relies on correctness review in order to determine eligibility

Review your spending limits in Billing settings. You can add or adjust custom eligibility rules. Learn more.

Copy link
Copy Markdown
Member

Note

This comment is posted by Julius' dot

The missing-Git fix matches the direction approved in #10351, but the PR supplies no executed results for its new driver and registry regression tests. Added tests alone do not satisfy verification. Please run the focused GitVcsDriver and VcsDriverRegistry tests, report the commands and results for missing Git and missing working directories, then request reconsideration.

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

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: VCS spawn error fires even with Git integration disabled and git not installed

2 participants