Skip to content

Commit 44d7cec

Browse files
committed
Fixed issue with splitting lines.
1 parent 2a9ac38 commit 44d7cec

File tree

1 file changed

+14
-4
lines changed
  • Assets/Plugins/CandyCoded.GitStatus/Scripts/CustomEditor

1 file changed

+14
-4
lines changed

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

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
#if UNITY_EDITOR
44
using System;
5+
using System.Collections.Generic;
6+
using System.IO;
57
using System.Diagnostics;
68
using System.Linq;
79
using Debug = UnityEngine.Debug;
@@ -48,10 +50,18 @@ public static string[] Branches()
4850
CreateNoWindow = true
4951
});
5052

51-
return process?.StandardOutput
52-
.ReadToEnd()
53-
.Split(Environment.NewLine.ToCharArray(), StringSplitOptions.RemoveEmptyEntries)
54-
.ToArray();
53+
var branches = new List<string>();
54+
55+
var stringReader = new StringReader(process?.StandardOutput.ReadToEnd());
56+
57+
while (stringReader.ReadLine() is string line)
58+
{
59+
60+
branches.Add(line.Trim('\''));
61+
62+
}
63+
64+
return branches.ToArray();
5565

5666
}
5767

0 commit comments

Comments
 (0)