Skip to content

Commit

Permalink
Update Git.cs to work on both Windows and Linux runners
Browse files Browse the repository at this point in the history
The current code uses "Environment.Name" to determine new line delimiter for reading filenames returned by GIT. This causes error for Windows agents/runners because GIT always return with "\n" for new line; whereas for Windows, the "Environment.Name" returned is "\r\n"
  • Loading branch information
ahmedbham authored Sep 26, 2023
1 parent ebcbe49 commit b08cf31
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/code/publisher/Git.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private static async ValueTask<string> GetDiffTreeOutput(CommitId commitId, Dire

private static ImmutableDictionary<CommitStatus, ImmutableList<FileInfo>> ParseDiffTreeOutput(string output, DirectoryInfo baseDirectory)
{
return output.Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries)
return output.Split("\n", StringSplitOptions.RemoveEmptyEntries)
.Choose<string, (CommitStatus Status, FileInfo File)>(line =>
{
var commitStatus = TryGetCommitStatusFromOutputLine(line);
Expand Down

0 comments on commit b08cf31

Please sign in to comment.