Skip to content

Commit

Permalink
Fetch specific branch name only in git-branch-push script (#14734)
Browse files Browse the repository at this point in the history
Co-authored-by: Ben Broderick Phillips <[email protected]>
  • Loading branch information
azure-sdk and benbp authored Jun 4, 2021
1 parent fea2e50 commit 497aac1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions eng/common/scripts/git-branch-push.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ param(
[boolean] $AmendCommit = $false
)

# This is necessay because of the janky git command output writing to stderr.
# This is necessary because of the git command output writing to stderr.
# Without explicitly setting the ErrorActionPreference to continue the script
# would fail the first time git wrote command output.
$ErrorActionPreference = "Continue"
Expand Down Expand Up @@ -116,8 +116,9 @@ do
$needsRetry = $true
Write-Host "Git push failed with LASTEXITCODE=$($LASTEXITCODE) Need to fetch and rebase: attempt number=$($tryNumber)"

Write-Host "git fetch $RemoteName"
git fetch $RemoteName
Write-Host "git fetch $RemoteName $PRBranchName"
# Full fetch will fail when the repo is in a sparse-checkout state, and single branch fetch is faster anyway.
git fetch $RemoteName $PRBranchName
if ($LASTEXITCODE -ne 0)
{
Write-Error "Unable to fetch remote LASTEXITCODE=$($LASTEXITCODE), see command output above."
Expand Down

0 comments on commit 497aac1

Please sign in to comment.