From addc756fbfb9ac00e6cf134afc7398da4a3044b1 Mon Sep 17 00:00:00 2001 From: wl2776 Date: Tue, 31 Dec 2024 04:28:00 +0300 Subject: [PATCH] feature: support several more variants of git installation on MacOS (#852) --- src/Native/MacOS.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Native/MacOS.cs b/src/Native/MacOS.cs index 62ae8c89..5721fe87 100644 --- a/src/Native/MacOS.cs +++ b/src/Native/MacOS.cs @@ -25,7 +25,12 @@ namespace SourceGit.Native public string FindGitExecutable() { - return File.Exists("/usr/bin/git") ? "/usr/bin/git" : string.Empty; + var gitPathVariants = new List() { + "/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)