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

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