@@ -12,12 +12,14 @@ namespace CandyCoded.GitStatus
12
12
public static class Git
13
13
{
14
14
15
+ public static string GitPath => "/usr/local/bin/git" ;
16
+
15
17
public static string Branch ( )
16
18
{
17
19
18
20
var process = Process . Start ( new ProcessStartInfo
19
21
{
20
- FileName = "/usr/local/bin/git" ,
22
+ FileName = GitPath ,
21
23
Arguments = "rev-parse --abbrev-ref HEAD" ,
22
24
UseShellExecute = false ,
23
25
RedirectStandardOutput = true ,
@@ -34,7 +36,7 @@ public static string[] Branches()
34
36
35
37
var process = Process . Start ( new ProcessStartInfo
36
38
{
37
- FileName = "/usr/local/bin/git" ,
39
+ FileName = GitPath ,
38
40
Arguments = "for-each-ref --format='%(refname:short)' refs/heads" ,
39
41
UseShellExecute = false ,
40
42
RedirectStandardOutput = true ,
@@ -54,7 +56,7 @@ public static void CheckoutBranch(string branch)
54
56
55
57
Process . Start ( new ProcessStartInfo
56
58
{
57
- FileName = "/usr/local/bin/git" ,
59
+ FileName = GitPath ,
58
60
Arguments = $ "checkout { branch } ",
59
61
UseShellExecute = false ,
60
62
RedirectStandardOutput = true ,
@@ -69,7 +71,7 @@ public static string[] AllChanges()
69
71
70
72
var process = Process . Start ( new ProcessStartInfo
71
73
{
72
- FileName = "/usr/local/bin/git" ,
74
+ FileName = GitPath ,
73
75
Arguments = "status --short --untracked-files --porcelain" ,
74
76
UseShellExecute = false ,
75
77
RedirectStandardOutput = true ,
@@ -103,7 +105,7 @@ public static void DiscardChanges(string path)
103
105
104
106
var process = Process . Start ( new ProcessStartInfo
105
107
{
106
- FileName = "/usr/local/bin/git" ,
108
+ FileName = GitPath ,
107
109
Arguments = $ "checkout { path } ",
108
110
UseShellExecute = false ,
109
111
RedirectStandardOutput = true ,
0 commit comments