From b08cf31a6a4242d42e5abea20c969a1829186f65 Mon Sep 17 00:00:00 2001 From: Ahmed Bham Date: Tue, 26 Sep 2023 13:39:58 -0700 Subject: [PATCH] Update Git.cs to work on both Windows and Linux runners 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" --- tools/code/publisher/Git.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/code/publisher/Git.cs b/tools/code/publisher/Git.cs index fe9b6fe..1dc5e44 100644 --- a/tools/code/publisher/Git.cs +++ b/tools/code/publisher/Git.cs @@ -59,7 +59,7 @@ internal static class Git private static ImmutableDictionary> ParseDiffTreeOutput(string output, DirectoryInfo baseDirectory) { - return output.Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries) + return output.Split("\n", StringSplitOptions.RemoveEmptyEntries) .Choose(line => { var commitStatus = TryGetCommitStatusFromOutputLine(line);