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

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