File tree Expand file tree Collapse file tree
eng/common/pipelines/templates/steps Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,6 +26,11 @@ steps:
2626 # Define this inline, because of the chicken/egg problem with loading a script when nothing
2727 # has been checked out yet.
2828 script : |
29+ # Setting $PSNativeCommandArgumentPassing to 'Legacy' to use PowerShell
30+ # 7.2 behavior for command argument passing. Newer behaviors will result
31+ # in errors from git.exe.
32+ $PSNativeCommandArgumentPassing = 'Legacy'
33+
2934 function SparseCheckout([Array]$paths, [Hashtable]$repository)
3035 {
3136 $dir = $repository.WorkingDirectory
8085 Write-Host "git -c advice.detachedHead=false checkout $commitish --"
8186
8287 # This will use the default branch if repo.Commitish is empty
83- Invoke-Expression -Command " git -c advice.detachedHead=false checkout $commitish --"
88+ git -c advice.detachedHead=false checkout $commitish --
8489 } else {
8590 Write-Host "Skipping checkout as repo has already been initialized"
8691 }
You can’t perform that action at this time.
0 commit comments