From 82962fe60c83a25dbca73a6f905ba46fdd9738a6 Mon Sep 17 00:00:00 2001 From: Austin Wise Date: Fri, 25 Oct 2019 03:15:56 -0700 Subject: [PATCH] Normalize git commondir path. The constructor for GitRepositoryLocation asserts that this path is normalized. On my machine, a git worktree created by git 2.22.0 does not result in path that satisfies this assert. --- src/Microsoft.Build.Tasks.Git/GitDataReader/GitRepository.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Microsoft.Build.Tasks.Git/GitDataReader/GitRepository.cs b/src/Microsoft.Build.Tasks.Git/GitDataReader/GitRepository.cs index a06a5bcc..0b3677ea 100644 --- a/src/Microsoft.Build.Tasks.Git/GitDataReader/GitRepository.cs +++ b/src/Microsoft.Build.Tasks.Git/GitDataReader/GitRepository.cs @@ -491,6 +491,8 @@ private static bool IsGitDirectory(string directory, out string commonDirectory) try { commonDirectory = Path.Combine(directory, File.ReadAllText(commonLinkPath).TrimEnd(CharUtils.AsciiWhitespace)); + // noralize relative paths + commonDirectory = Path.GetFullPath(commonDirectory); } catch {