Skip to content

Commit 3d05f63

Browse files
committed
Extracted git path to static variable.
1 parent aa69c0e commit 3d05f63

File tree

1 file changed

+7
-5
lines changed
  • Assets/Plugins/CandyCoded.GitStatus/Scripts/CustomEditor

1 file changed

+7
-5
lines changed

Assets/Plugins/CandyCoded.GitStatus/Scripts/CustomEditor/Git.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@ namespace CandyCoded.GitStatus
1212
public static class Git
1313
{
1414

15+
public static string GitPath => "/usr/local/bin/git";
16+
1517
public static string Branch()
1618
{
1719

1820
var process = Process.Start(new ProcessStartInfo
1921
{
20-
FileName = "/usr/local/bin/git",
22+
FileName = GitPath,
2123
Arguments = "rev-parse --abbrev-ref HEAD",
2224
UseShellExecute = false,
2325
RedirectStandardOutput = true,
@@ -34,7 +36,7 @@ public static string[] Branches()
3436

3537
var process = Process.Start(new ProcessStartInfo
3638
{
37-
FileName = "/usr/local/bin/git",
39+
FileName = GitPath,
3840
Arguments = "for-each-ref --format='%(refname:short)' refs/heads",
3941
UseShellExecute = false,
4042
RedirectStandardOutput = true,
@@ -54,7 +56,7 @@ public static void CheckoutBranch(string branch)
5456

5557
Process.Start(new ProcessStartInfo
5658
{
57-
FileName = "/usr/local/bin/git",
59+
FileName = GitPath,
5860
Arguments = $"checkout {branch}",
5961
UseShellExecute = false,
6062
RedirectStandardOutput = true,
@@ -69,7 +71,7 @@ public static string[] AllChanges()
6971

7072
var process = Process.Start(new ProcessStartInfo
7173
{
72-
FileName = "/usr/local/bin/git",
74+
FileName = GitPath,
7375
Arguments = "status --short --untracked-files --porcelain",
7476
UseShellExecute = false,
7577
RedirectStandardOutput = true,
@@ -103,7 +105,7 @@ public static void DiscardChanges(string path)
103105

104106
var process = Process.Start(new ProcessStartInfo
105107
{
106-
FileName = "/usr/local/bin/git",
108+
FileName = GitPath,
107109
Arguments = $"checkout {path}",
108110
UseShellExecute = false,
109111
RedirectStandardOutput = true,

0 commit comments

Comments
 (0)