Skip to content

Commit

Permalink
Fix bug in git branch push (#17188)
Browse files Browse the repository at this point in the history
Co-authored-by: Chidozie Ononiwu <chononiw@microsoft.com>
  • Loading branch information
azure-sdk and chidozieononiwu authored Nov 5, 2020
1 parent 2235381 commit c50ed33
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions eng/common/scripts/git-branch-push.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ param(
[string] $RemoteName = "azure-sdk-fork",

[Parameter(Mandatory = $false)]
[boolean] $SkipCommit = $false
[boolean] $SkipCommit = $false,

[Parameter(Mandatory = $false)]
[boolean] $AmendCommit = $false
)

# This is necessay because of the janky git command output writing to stderr.
Expand Down Expand Up @@ -66,8 +69,14 @@ if ($LASTEXITCODE -ne 0)
}

if (!$SkipCommit) {
Write-Host "git -c user.name=`"azure-sdk`" -c user.email=`"azuresdk@microsoft.com`" commit --amend -am `"$($CommitMsg)`""
git -c user.name="azure-sdk" -c user.email="azuresdk@microsoft.com" commit --amend -am "$($CommitMsg)"
if ($AmendCommit) {
$amendOption = "--amend"
}
else {
$amendOption = ""
}
Write-Host "git -c user.name=`"azure-sdk`" -c user.email=`"azuresdk@microsoft.com`" commit $amendOption -am `"$($CommitMsg)`""
git -c user.name="azure-sdk" -c user.email="azuresdk@microsoft.com" commit $amendOption -am "$($CommitMsg)"
if ($LASTEXITCODE -ne 0)
{
Write-Error "Unable to add files and create commit LASTEXITCODE=$($LASTEXITCODE), see command output above."
Expand Down

0 comments on commit c50ed33

Please sign in to comment.