Disable detached head warnings on sparse checkout to commit (#3680)

Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>
This commit is contained in:
Azure SDK Bot 2022-06-02 12:16:11 -07:00 committed by GitHub
parent 6b903d0b3f
commit 3aa878eb3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -59,8 +59,9 @@ steps:
# sparse-checkout commands after initial checkout will auto-checkout again
if (!$hasInitialized) {
Write-Host "git checkout $($repository.Commitish)"
git checkout $($repository.Commitish) # this will use the default branch if repo.Commitish is empty
Write-Host "git -c advice.detachedHead=false checkout $($repository.Commitish)"
# This will use the default branch if repo.Commitish is empty
git -c advice.detachedHead=false checkout $($repository.Commitish)
} else {
Write-Host "Skipping checkout as repo has already been initialized"
}