feature: support several more variants of git installation on MacOS (#852)

This commit is contained in:
wl2776 2024-12-31 04:28:00 +03:00 committed by GitHub
parent ced1737bdc
commit addc756fbf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -25,7 +25,12 @@ namespace SourceGit.Native
public string FindGitExecutable() public string FindGitExecutable()
{ {
return File.Exists("/usr/bin/git") ? "/usr/bin/git" : string.Empty; var gitPathVariants = new List<string>() {
"/usr/bin/git", "/usr/local/bin/git", "/opt/homebrew/bin/git", "/opt/homebrew/opt/git/bin/git"
};
foreach (var path in gitPathVariants)
if (File.Exists(path)) return path;
return string.Empty;
} }
public string FindTerminal(Models.ShellOrTerminal shell) public string FindTerminal(Models.ShellOrTerminal shell)