diff --git a/git-flow b/git-flow index b34c31e..ca72cde 100755 --- a/git-flow +++ b/git-flow @@ -357,8 +357,16 @@ def tag_command(): until_dash = last_version.index("-") if "-" in last_version else None [major, minor, patch] = map(int, last_version[from_major:until_dash].split(".")) - merged_branch_type = merged_branch[:merged_branch.index('/')] if '/' in merged_branch else merged_branch - increment = BRANCH_TYPES_INCREMENT[merged_branch_type] + components = merged_branch.split("/") + + if len(components) not in [2, 4]: + raise RuntimeError("Branch mergeado es inválido: " + merged_branch) + elif len(components) == 4 and components[0] != "release": + raise RuntimeError("Release branch mergeado es inválido: " + merged_branch) + elif components[-2] not in BRANCH_TYPES: + raise RuntimeError("Tipo de rama mergeado es inválido: " + components[-2]) + + increment = BRANCH_TYPES_INCREMENT[components[-2]] if increment == "major": major = major + 1