Skip to content

Commit

Permalink
Normalize git commondir path.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
AustinWise committed Oct 25, 2019
1 parent d2c5524 commit 82962fe
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Microsoft.Build.Tasks.Git/GitDataReader/GitRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down

0 comments on commit 82962fe

Please sign in to comment.