Remove AmendCommit parameter (#893)

Co-authored-by: Chidozie Ononiwu <chononiw@microsoft.com>
This commit is contained in:
Azure SDK Bot 2020-11-02 19:48:58 -08:00 committed by GitHub
parent e099942e25
commit c76fe99788
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 13 deletions

View File

@ -30,7 +30,9 @@ foreach ($branch in $branches)
exit 1
}
if ($pullRequests -and (($pullRequests | ? { $_.State -eq "open" }).Count -eq 0))
$openPullRequests = $pullRequests | ? { $_.State -eq "open" }
if ($openPullRequests.Count -eq 0)
{
LogDebug "Branch [ $branchName ] in repo [ $RepoName ] has no associated open Pull Request. Deleting Branch"
try{

View File

@ -30,10 +30,7 @@ param(
[string] $RemoteName = "azure-sdk-fork",
[Parameter(Mandatory = $false)]
[boolean] $SkipCommit = $false,
[Parameter(Mandatory = $false)]
[boolean] $AmendCommit = $false
[boolean] $SkipCommit = $false
)
# This is necessay because of the janky git command output writing to stderr.
@ -69,14 +66,8 @@ if ($LASTEXITCODE -ne 0)
}
if (!$SkipCommit) {
if ($AmendCommit) {
Write-Host "git -c user.name=`"azure-sdk`" -c user.email=`"azuresdk@microsoft.com`" commit -am `"$($CommitMsg)`""
git -c user.name="azure-sdk" -c user.email="azuresdk@microsoft.com" commit --amend -am "$($CommitMsg)"
}
else {
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 -am "$($CommitMsg)"
}
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 ($LASTEXITCODE -ne 0)
{
Write-Error "Unable to add files and create commit LASTEXITCODE=$($LASTEXITCODE), see command output above."