Add check to disallow creation of a new release/hotfix branch when there
still exists one.
diff --git a/git-flow-hotfix b/git-flow-hotfix
index cee8d2f..b0df9ac 100644
--- a/git-flow-hotfix
+++ b/git-flow-hotfix
@@ -112,12 +112,21 @@
fi
}
+require_no_existing_hotfix_branches() {
+ local hotfix_branches=$(echo "$LOCAL_BRANCHES" | grep "^$PREFIX")
+ local first_branch=$(echo ${hotfix_branches} | head -n1)
+ first_branch=${first_branch#$PREFIX}
+ [ -z "$hotfix_branches" ] || \
+ die "There is an existing hotfix branch ($first_branch). Finish that one first."
+}
+
cmd_start() {
DEFINE_boolean fetch true "fetch from $ORIGIN before performing finish" F
parse_args "$@"
BASE=${2:-$MASTER_BRANCH}
require_version_arg
require_base_is_on_master
+ require_no_existing_hotfix_branches
# sanity checks
gitflow_require_clean_working_tree