From 9c2a074aaffa6b1682573f3869b35aec96f9525a Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Thu, 8 Jul 2021 17:13:50 -0700 Subject: [PATCH] Add root directory to list of sparse checkout paths (#19732) Explicitly add '/*' '!/*/' to the list of paths so we include the files in the root of the repo. Added some extra command logging so we can easily repro locally without needing to find the code that ran. Update to '/eng' so that we only get paths that start with eng instead of every path that has eng as a folder. Co-authored-by: Wes Haggard --- eng/common/pipelines/templates/steps/sparse-checkout.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/eng/common/pipelines/templates/steps/sparse-checkout.yml b/eng/common/pipelines/templates/steps/sparse-checkout.yml index 10147521dbe1..50603bc35a24 100644 --- a/eng/common/pipelines/templates/steps/sparse-checkout.yml +++ b/eng/common/pipelines/templates/steps/sparse-checkout.yml @@ -39,9 +39,15 @@ steps: Write-Host "Repository $($repository.Name) has already been initialized. Skipping this step." } else { Write-Host "Repository $($repository.Name) is being initialized." + + Write-Host "git clone --no-checkout --filter=tree:0 git://github.com/$($repository.Name) ." git clone --no-checkout --filter=tree:0 git://github.com/$($repository.Name) . + + Write-Host "git sparse-checkout init" git sparse-checkout init - git sparse-checkout set eng + + Write-Host "git sparse-checkout set '/*' '!/*/' '/eng'" + git sparse-checkout set '/*' '!/*/' '/eng' } $gitsparsecmd = "git sparse-checkout add $paths"