Skip to content

Commit 57b45c5

Browse files
azure-sdkbenbp
andauthored
Disable detached head warnings on sparse checkout to commit (Azure#18257)
Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>
1 parent 6837144 commit 57b45c5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

eng/common/pipelines/templates/steps/sparse-checkout.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,9 @@ steps:
5959
6060
# sparse-checkout commands after initial checkout will auto-checkout again
6161
if (!$hasInitialized) {
62-
Write-Host "git checkout $($repository.Commitish)"
63-
git checkout $($repository.Commitish) # this will use the default branch if repo.Commitish is empty
62+
Write-Host "git -c advice.detachedHead=false checkout $($repository.Commitish)"
63+
# This will use the default branch if repo.Commitish is empty
64+
git -c advice.detachedHead=false checkout $($repository.Commitish)
6465
} else {
6566
Write-Host "Skipping checkout as repo has already been initialized"
6667
}

0 commit comments

Comments
 (0)