Skip to content

Commit 17c7d31

Browse files
committed
fix(bump): fix bump find_increment error
in the previous design, MAJOR will be overwritten by other
1 parent 2803b18 commit 17c7d31

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

commitizen/bump.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ def find_increment(
3434
continue
3535
found_keyword = result.group(0)
3636
new_increment = increments_map_default[found_keyword]
37-
if new_increment == "MAJOR":
38-
increment = new_increment
39-
break
40-
elif increment == "MINOR" and new_increment == "PATCH":
37+
if increment == "MAJOR":
4138
continue
42-
increment = new_increment
39+
elif increment == "MINOR" and new_increment == "MAJOR":
40+
increment = new_increment
41+
elif increment == "PATCH" or increment is None:
42+
increment = new_increment
4343

4444
return increment
4545

0 commit comments

Comments
 (0)