Skip to content

Commit 16a1b9e

Browse files
committed
fix(pre-commit-hooks): allow empty ranges in 'commitizen-branch'
Details: Force-pushing a branch back to an older commit pushes no new commits, so the range is empty and 'cz check' blocks the push: > No commit found with range: '...' Ignore this error (exit code 3) with '--no-raise 3'. Invalid commit messages are still rejected. --- Signed-off-by: Adrian DC <radian.dc@gmail.com>
1 parent 51ada02 commit 16a1b9e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎.pre-commit-hooks.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
the fact (e.g., pre-push or in CI) without an expensive check of the entire
2020
repository history.
2121
entry: cz
22-
args: [check, --rev-range, "$PRE_COMMIT_FROM_REF..$PRE_COMMIT_TO_REF"]
22+
args: [--no-raise, "3", check, --rev-range, "$PRE_COMMIT_FROM_REF..$PRE_COMMIT_TO_REF"]
2323
always_run: true
2424
pass_filenames: false
2525
language: python

0 commit comments

Comments
 (0)