From bd6c84baacaa0b469fe6c6a66007a37dc7e63810 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Sat, 27 May 2023 13:58:45 +0200 Subject: other: Update git hook --- .githooks/update | 4 ++++ 1 file changed, 4 insertions(+) (limited to '.githooks') diff --git a/.githooks/update b/.githooks/update index 1b8d57769..0f537a164 100755 --- a/.githooks/update +++ b/.githooks/update @@ -44,6 +44,9 @@ def get_commit_shas(start_ref: str, end_ref: str) -> List[str]: data = subprocess.check_output(['git', 'rev-list', arg]) text = data.decode() text = text.strip() + if not text: + # Can happen if commits are deleted after force push + return [] return text.split('\n') @@ -79,6 +82,7 @@ def main(args: Tuple[str, str, str]) -> None: shas = get_commit_shas(old_ref, new_ref) for sha in shas: + print('Check', sha) subject = get_commit_subject(sha) enforce_message_rules(subject) -- cgit v1.2.3