Skip to content

Commit

Permalink
Disable detached head warnings on sparse checkout to commit (#29100)
Browse files Browse the repository at this point in the history
Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>
  • Loading branch information
azure-sdk and benbp authored Jun 2, 2022
1 parent f955a96 commit 8448649
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions eng/common/pipelines/templates/steps/sparse-checkout.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down

0 comments on commit 8448649

Please sign in to comment.