Resolve git outside the session PATH

A desktop launch inherits a `PATH` that holds none of the user's own
install locations, so `Command::new("git")` finds nothing usable, or on
macOS finds Apple's shim and only prompts to install the developer
tools.

Resolve git to an absolute path instead, searching `PATH` first and the
usual install locations after, and cache the result for the process.
`rad` is looked for the same way, which also fixes the CLI check for a
Homebrew or Nix install.
This commit is contained in:
Rūdolfs Ošiņš
2026-09-08 09:30:14 +02:00
parent fe37d6a85c
commit f8faec2c9b
6 changed files with 316 additions and 88 deletions
Generated
+10
View File
@@ -4080,6 +4080,7 @@ dependencies = [
"thiserror 2.0.19",
"ts-rs",
"url",
"which",
]
[[package]]
@@ -6605,6 +6606,15 @@ version = "0.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a28ac98ddc8b9274cb41bb4d9d4d5c425b6020c50c46f25559911905610b4a88"
[[package]]
name = "which"
version = "8.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f3ef584124b911bcc3875c2f1472e80f24361ceb789bd1c62b3e9a3df9ff43c"
dependencies = [
"libc",
]
[[package]]
name = "winapi"
version = "0.3.9"