Skip to content

Commit 02fc83f

Browse files
authored
Recreate branch if it already exists (#19670)
* Recreate branch if it already exists * add changelog * adjust test
1 parent c36f1ff commit 02fc83f

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

ddev/changelog.d/19670.fixed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Recreate release branch if it already exists.

ddev/src/ddev/cli/release/branch/create.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def create(app: Application, branch_name):
4141
app.display_success("Done.")
4242

4343
app.display_waiting(f"Creating the release branch `{branch_name}`...")
44-
app.repo.git.run('checkout', '-b', branch_name)
44+
app.repo.git.run('checkout', '-B', branch_name)
4545
app.display_success("Done.")
4646

4747
app.display_waiting(f"Pushing the release branch `{branch_name}`...")

ddev/tests/cli/release/branch/test_create.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def test_create_branch(ddev, mocker):
2929
assert run_mock.call_args_list == [
3030
mocker.call('checkout', 'master'),
3131
mocker.call('pull', 'origin', 'master'),
32-
mocker.call('checkout', '-b', '5.5.x'),
32+
mocker.call('checkout', '-B', '5.5.x'),
3333
mocker.call('push', 'origin', '5.5.x'),
3434
]
3535

0 commit comments

Comments
 (0)