From c05f902f6aca4171ba9399cbb15d8cc7bedcb244 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Mon, 5 Feb 2024 20:18:37 -0800 Subject: [PATCH] Sync eng/common directory with azure-sdk-tools for PR 7634 (#22348) * Fix sparse-checkout git command line behavior * Use command arg parsing behavior in sparse-checkout.yml --------- Co-authored-by: Daniel Jurek --- eng/common/pipelines/templates/steps/sparse-checkout.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/eng/common/pipelines/templates/steps/sparse-checkout.yml b/eng/common/pipelines/templates/steps/sparse-checkout.yml index 1f5e3fc375f7..24f4f547476e 100644 --- a/eng/common/pipelines/templates/steps/sparse-checkout.yml +++ b/eng/common/pipelines/templates/steps/sparse-checkout.yml @@ -26,6 +26,11 @@ steps: # Define this inline, because of the chicken/egg problem with loading a script when nothing # has been checked out yet. script: | + # Setting $PSNativeCommandArgumentPassing to 'Legacy' to use PowerShell + # 7.2 behavior for command argument passing. Newer behaviors will result + # in errors from git.exe. + $PSNativeCommandArgumentPassing = 'Legacy' + function SparseCheckout([Array]$paths, [Hashtable]$repository) { $dir = $repository.WorkingDirectory