summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xutils/checkstyle.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/utils/checkstyle.py b/utils/checkstyle.py
index 78645410..5cc523b6 100755
--- a/utils/checkstyle.py
+++ b/utils/checkstyle.py
@@ -360,6 +360,11 @@ class TitleChecker(CommitChecker):
def check(cls, commit, top_level):
title = commit.title
+ # Skip the check when validating staged changes (as done through a
+ # pre-commit hook) as there is no title to check in that case.
+ if isinstance(commit, StagedChanges):
+ return []
+
# Ignore release commits, they don't need a prefix.
if TitleChecker.release_regex.fullmatch(title):
return []