Skip to content

Commit 4ca4545

Browse files
committed
Fix ReleaseTools to checkout, create, or reset release branch
The option was supposed to be `-B` not `-b`, the former will forcibly reset the local branch instead of failing if it already exists.
1 parent 25e09e4 commit 4ca4545

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tools/ReleaseTools.psm1

+3-3
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ function Update-Branch {
180180
Use-Repository -RepositoryName $RepositoryName -Script {
181181
$Branch = git branch --show-current
182182
if ($Branch -ne "release") {
183-
if ($PSCmdlet.ShouldProcess("release", "git checkout -b")) {
184-
git checkout -b "release"
183+
if ($PSCmdlet.ShouldProcess("release", "git checkout -B")) {
184+
git checkout -B "release"
185185
}
186186
}
187187
}
@@ -389,7 +389,7 @@ function New-ReleasePR {
389389
Use-Repository -RepositoryName $RepositoryName -Script {
390390
if ($PSCmdlet.ShouldProcess("$RepositoryName/release", "git push")) {
391391
Write-Host "Pushing release branch..."
392-
git push --force-with-lease origin release
392+
git push --set-upstream --force-with-lease origin release
393393
}
394394
}
395395

0 commit comments

Comments
 (0)