Skip to content

Commit

Permalink
Don't attempt to delete remote branch after a PR has landed.
Browse files Browse the repository at this point in the history
GitHub deletes the remote branch automatically when the PR is merged, so
we don't to explicitly do that. Trying to delete it currently results in
an error like this:
```
error: unable to delete 'ZolotukhinM/stack/1': remote ref does not exist
error: failed to push some refs to '...'
```
The code for deleting the branch has been sitting there for a long time,
but until a fix in #27 it used incorrect branch names.
  • Loading branch information
ZolotukhinM committed Oct 12, 2024
1 parent a1256e7 commit 88cc3bd
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/stack_pr/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1117,9 +1117,6 @@ def command_land(args: CommonArgs):
)

delete_local_branches(st, args.verbose)
delete_remote_branches(
st[:1], args.remote, args.verbose, args.branch_name_template
)

# If local branch {target} exists, rebase it on the remote/target
if branch_exists(args.target):
Expand Down

0 comments on commit 88cc3bd

Please sign in to comment.