-
Notifications
You must be signed in to change notification settings - Fork 692
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ArPow] Use --work-tree with git apply #4254
Conversation
This makes things work bettern in a source-tarball build (where there may not be a .git directory), or there might be a .git directory but it's for a different repo than the one we are building.
cc @dotnet/source-build-contrib |
Hm... @dotnet/source-build-contrib isn't working? |
@@ -55,7 +55,7 @@ | |||
</ItemGroup> | |||
|
|||
<Exec | |||
Command="git apply --ignore-whitespace --whitespace=nowarn "%(SourceBuildPatchFile.FullPath)"" | |||
Command="git --work-tree=$(ProjectRoot) apply --ignore-whitespace --whitespace=nowarn "%(SourceBuildPatchFile.FullPath)"" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used ProjectRoot
based on the WorkingDirectory
set on the next line; is there a better variable name I should be using instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think ProjectRoot
is correct here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved for insertion into dev branch.
Bug
Fixes: NuGet/Home#11227
Regression? Last working version: Not a really a regression in NuGet.Client, though it is a regression from source-build 5.0.
Description
See the issue for details about the problem and how to reproduce.
Use
git --work-tree=path apply
to ensure thatgit apply
works even if the sources are copied somewhere else or the.git
directory is removed and the code just happens to be placed somewhere under a git repository.This is the same fix that's used everywhere else within ArPow: https://github.com/dotnet/installer/blob/74507010fafeb931a063f8649bff0b032ebc725b/src/SourceBuild/tarball/content/repos/Directory.Build.targets#L83
PR Checklist
PR has a meaningful title
PR has a linked issue.
Described changes
Tests
Documentation