petervanderdoes/gitflow — pull request #53 by adutra (2012-12-20 14:10:34+00:00)
Title: Switch to another branch before deleting current release/hotfix local branch

Currently for releases and hotfixes, when one tries to delete the current local branch, it sometimes happens that that branch is still the current one (e.g. if the merge back to master/develop already took place in a previous attempt to finish).

In these situations, the local branch cannot be deleted. The error message is:

> error: Cannot delete the branch 'hotfix/xxx' which you are currently on.

One must checkout another branch before deleting the release/hotfix branch.

The git-flow-feature script already does such a check.