From 07a56bc5e3e728fbbcf37a84bb9d37fec1ee7efc Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Mon, 11 Jul 2022 10:41:11 -0700 Subject: [PATCH] Use --no-cone in pipeline sparse checkout script (#3815) Co-authored-by: Ben Broderick Phillips --- eng/common/pipelines/templates/steps/sparse-checkout.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/eng/common/pipelines/templates/steps/sparse-checkout.yml b/eng/common/pipelines/templates/steps/sparse-checkout.yml index 49f9eb553..a3b553b3a 100644 --- a/eng/common/pipelines/templates/steps/sparse-checkout.yml +++ b/eng/common/pipelines/templates/steps/sparse-checkout.yml @@ -44,8 +44,10 @@ steps: Write-Host "git sparse-checkout init" git sparse-checkout init - Write-Host "git sparse-checkout set '/*' '!/*/' '/eng'" - git sparse-checkout set '/*' '!/*/' '/eng' + # Set non-cone mode otherwise path filters will not work in git >= 2.37.0 + # See https://github.blog/2022-06-27-highlights-from-git-2-37/#tidbits + Write-Host "git sparse-checkout set --no-cone '/*' '!/*/' '/eng'" + git sparse-checkout set --no-cone '/*' '!/*/' '/eng' } # Prevent wildcard expansion in Invoke-Expression (e.g. for checkout path '/*')