diff --git a/eng/common/scripts/TypeSpec-Project-Sync.ps1 b/eng/common/scripts/TypeSpec-Project-Sync.ps1 index f8656bc1d..0cf2700e6 100644 --- a/eng/common/scripts/TypeSpec-Project-Sync.ps1 +++ b/eng/common/scripts/TypeSpec-Project-Sync.ps1 @@ -105,8 +105,8 @@ if ( $configuration["repo"] -and $configuration["commit"]) { try { if (!(Test-Path ".git")) { InitializeSparseGitClone $gitRemoteValue - UpdateSparseCheckoutFile $specSubDirectory $configuration["additionalDirectories"] } + UpdateSparseCheckoutFile $specSubDirectory $configuration["additionalDirectories"] git checkout $configuration["commit"] if ($LASTEXITCODE) { exit $LASTEXITCODE } }