Skip to content

fix(delete): Check if remote exists before deleting it#83

Open
dermojo wants to merge 1 commit intogittower:mainfrom
dermojo:bugfix/82-delete-remote
Open

fix(delete): Check if remote exists before deleting it#83
dermojo wants to merge 1 commit intogittower:mainfrom
dermojo:bugfix/82-delete-remote

Conversation

@dermojo
Copy link

@dermojo dermojo commented Feb 24, 2026

When deleting a remote branch, check whether if exists first. Trying to delete a branch that doesn't exist anymore isn't a failure.

The implemented fix is a simple check before trying to delete the remote branch.

Resolves #82

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to make git flow <type> delete --remote resilient when the remote branch no longer exists (e.g., deleted via web UI), treating that case as non-fatal and resolving #82.

Changes:

  • Adds a pre-check before attempting remote branch deletion in the delete command.
  • Updates the delete command test to expect success when the remote branch is missing.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
cmd/delete.go Skips remote deletion attempt based on a remote-branch existence check.
test/cmd/delete_test.go Updates test expectations to treat deleting a non-existent remote branch as success.

When deleting a remote branch, check whether if exists first.
Trying to delete a branch that doesn't exist anymore isn't a failure.

Resolves gittower#82
@dermojo dermojo force-pushed the bugfix/82-delete-remote branch from 895549f to 2318250 Compare March 3, 2026 07:47
@dermojo
Copy link
Author

dermojo commented Mar 9, 2026

Is there anything left to do for me in this pull request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Delete fails if remote doesn't exist

2 participants