Blame SOURCES/vstest-use-work-tree-with-git-apply.patch

2e7fc5
From b2c4b2427d8c1a2410c4210789caccf1ec87e64a Mon Sep 17 00:00:00 2001
2e7fc5
From: Omair Majid <omajid@redhat.com>
2e7fc5
Date: Thu, 9 Sep 2021 13:21:51 -0400
2e7fc5
Subject: [PATCH] [ArPow] Use --work-tree with git apply
2e7fc5
2e7fc5
This makes things work better in a source-tarball build, where there may
2e7fc5
be a .git directory somewhere in our parent directories but it's for a
2e7fc5
different repo than vstest. In a situation like that a plain `git apply`
2e7fc5
will (silently!) ignore patches because they wont apply to the unrelated
2e7fc5
repository. That will (eventually) make the source-build fail.
2e7fc5
`--work-tree` makes git directly use the directory that we care about.
2e7fc5
2e7fc5
See https://github.com/dotnet/source-build/issues/2445 for more details.
2e7fc5
---
2e7fc5
 eng/SourceBuild.props | 2 +-
2e7fc5
 1 file changed, 1 insertion(+), 1 deletion(-)
2e7fc5
2e7fc5
diff --git a/eng/SourceBuild.props b/eng/SourceBuild.props
2e7fc5
index b365645c..68f82592 100644
2e7fc5
--- a/eng/SourceBuild.props
2e7fc5
+++ b/eng/SourceBuild.props
2e7fc5
@@ -24,7 +24,7 @@
2e7fc5
     </ItemGroup>
2e7fc5
 
2e7fc5
     
2e7fc5
-      Command="git apply --ignore-whitespace --whitespace=nowarn "%(SourceBuildPatchFile.FullPath)""
2e7fc5
+      Command="git --work-tree="$(InnerSourceBuildRepoRoot)" apply --ignore-whitespace --whitespace=nowarn "%(SourceBuildPatchFile.FullPath)""
2e7fc5
       WorkingDirectory="$(InnerSourceBuildRepoRoot)"
2e7fc5
       Condition="'@(SourceBuildPatchFile)' != ''" />
2e7fc5
   </Target>
2e7fc5
-- 
2e7fc5
2.31.1
2e7fc5