You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Without git on PATH the app crashes at startup and when a cloned repo is selected, and clone/fetch/pull fail without a log line #520
GitCli.Run (ProjectDirector/GitCli.cs ~L107) calls RunCommand.Execute("git", arguments, handler) without any guard. The synchronous Execute in ktsu.RunCommand blocks on ExecuteAsync(...).Result, and process.Start() isn't caught there. So when the git executable can't be found, GitCli.Run throws an AggregateException wrapping a Win32Exception, where it should return a failed GitResult. Nothing in ProjectDirector catches either type.
Why it matters
This is a realistic setup for the app's users: GitHub Desktop bundles its own git and doesn't put it on PATH, and the app has an "Open in GHD" button.
Startup: the constructor calls RefreshPage() (ProjectDirector.cs ~L140, ~L837–843), which calls UpdateClonedStatus and then GitCli.IsRepository. For any repo whose clone directory exists, git is run and throws. Once a cloned repo is saved in settings, the app can't start until someone edits the settings JSON by hand.
Selecting a repo:SwitchPage(baseRepo) (~L670–679) calls UpdateClonedStatus on the render thread and crashes. Scan > Dev Dir crashes the same way (~L1342).
Background work:
Fetch (~L494), pull (~L552), commit and push run as bare Tasks, so the exception goes unobserved and nothing reaches the git log. Auto-fetch fails silently every minute.
Clone runs through CloneTracker.TryRun, whose finally only re-enables the button.
The sibling comparison's catch filter (~L1517: IOException/UnauthorizedAccessException/InvalidOperationException/ArgumentException) doesn't match AggregateException, so Similar Repos stays on "Comparing repositories..." for good.
Suggested fix
In GitCli.Run, catch Win32Exception, including one wrapped in an AggregateException. Return a failed GitResult, for example exit code -1 with the error "git was not found on PATH; install Git or add it to PATH".
Callers already handle !Succeeded, so clone, fetch and pull would then report the failure through QueueGitLog, and IsRepository would return false instead of throwing.
Optionally, run git --version once at startup and log the same message.
Acceptance criteria
A test that points PATH at an empty directory and asserts that GitCli.Run("--version") returns a failed result with an explanatory error instead of throwing.
Starting the app with a cloned repo in settings and no git on PATH doesn't crash, and the git log explains the problem.
Not the same as #466 (launching github/explorer) or #519 (git prompting for credentials).
Priority: High. When git isn't on PATH, a crash at startup is a hard failure: once a cloned repo is saved in settings, the app won't open until someone edits the settings JSON by hand. This is a realistic setup, because GitHub Desktop users get a bundled git that isn't on PATH. Selecting a repo also crashes on the render thread, and background clone, fetch and pull fail without a log line.
Area / suggested owner: git subprocess layer (GitCli.Run), plus the callers' exception handling (UpdateClonedStatus, the sibling-comparison catch filter). The fix is small and contained: return a failed GitResult on Win32Exception/AggregateException, and the existing !Succeeded paths take care of reporting.
Activity
matt-edmondson commentedon Oct 31, 2026
Triage
GitCli.Run), plus the callers' exception handling (UpdateClonedStatus, the sibling-comparison catch filter). The fix is small and contained: return a failedGitResultonWin32Exception/AggregateException, and the existing!Succeededpaths take care of reporting.Executesurfaces the start failure as anAggregateException. It may be worth a look there too, but that isn't needed to fix this.Generated by Claude Code