File tree Expand file tree Collapse file tree 2 files changed +6
-13
lines changed
Expand file tree Collapse file tree 2 files changed +6
-13
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,9 @@ foreach ($branch in $branches)
3030 exit 1
3131 }
3232
33- if ($pullRequests -and (($pullRequests | ? { $_.State -eq " open" }).Count -eq 0 ))
33+ $openPullRequests = $pullRequests | ? { $_.State -eq " open" }
34+
35+ if ($openPullRequests.Count -eq 0 )
3436 {
3537 LogDebug " Branch [ $branchName ] in repo [ $RepoName ] has no associated open Pull Request. Deleting Branch"
3638 try {
Original file line number Diff line number Diff line change @@ -30,10 +30,7 @@ param(
3030 [string ] $RemoteName = " azure-sdk-fork" ,
3131
3232 [Parameter (Mandatory = $false )]
33- [boolean ] $SkipCommit = $false ,
34-
35- [Parameter (Mandatory = $false )]
36- [boolean ] $AmendCommit = $false
33+ [boolean ] $SkipCommit = $false
3734)
3835
3936# This is necessay because of the janky git command output writing to stderr.
@@ -69,14 +66,8 @@ if ($LASTEXITCODE -ne 0)
6966}
7067
7168if (! $SkipCommit ) {
72- if ($AmendCommit ) {
73- Write-Host " git -c user.name=`" azure-sdk`" -c user.email=`" azuresdk@microsoft.com`" commit -am `" $ ( $CommitMsg ) `" "
74- git - c user.name= " azure-sdk" - c user.email= " azuresdk@microsoft.com" commit -- amend - am " $ ( $CommitMsg ) "
75- }
76- else {
77- Write-Host " git -c user.name=`" azure-sdk`" -c user.email=`" azuresdk@microsoft.com`" commit --amend -am `" $ ( $CommitMsg ) `" "
78- git - c user.name= " azure-sdk" - c user.email= " azuresdk@microsoft.com" commit - am " $ ( $CommitMsg ) "
79- }
69+ Write-Host " git -c user.name=`" azure-sdk`" -c user.email=`" azuresdk@microsoft.com`" commit --amend -am `" $ ( $CommitMsg ) `" "
70+ git - c user.name= " azure-sdk" - c user.email= " azuresdk@microsoft.com" commit -- amend - am " $ ( $CommitMsg ) "
8071 if ($LASTEXITCODE -ne 0 )
8172 {
8273 Write-Error " Unable to add files and create commit LASTEXITCODE=$ ( $LASTEXITCODE ) , see command output above."
You can’t perform that action at this time.
0 commit comments