adds a check to avoid the delete release branch problem in release finish
diff --git a/git-flow-release b/git-flow-release
index e71c87b..d573da1 100644
--- a/git-flow-release
+++ b/git-flow-release
@@ -149,6 +149,15 @@
die "There is an existing release branch ($first_branch). Finish that one first."
}
+git_actual_branch(){
+ git branch --no-color | grep '^*' | sed 's/^[* ] //'
+}
+require_not_being_in_release_branch() {
+ if has $BRANCH $(git_actual_branch); then
+ die "You cannot be in the '$BRANCH' branch when you finnish it."
+ fi
+}
+
cmd_start() {
DEFINE_boolean fetch false "fetch from $ORIGIN before performing finish" F
parse_args "$@"
@@ -203,6 +212,7 @@
# sanity checks
require_branch "$BRANCH"
require_clean_working_tree
+ require_not_being_in_release_branch
if flag fetch; then
git fetch -q "$ORIGIN" "$MASTER_BRANCH" || \
die "Could not fetch $MASTER_BRANCH from $ORIGIN."