diff options
author | Philipp Hörist <philipp@hoerist.com> | 2023-05-27 14:58:45 +0300 |
---|---|---|
committer | Philipp Hörist <philipp@hoerist.com> | 2023-05-27 14:58:45 +0300 |
commit | bd6c84baacaa0b469fe6c6a66007a37dc7e63810 (patch) | |
tree | b965798563fc734d6c20b20de59d919a2e1e7b06 /.githooks | |
parent | 754f916833f5deaaeea4acab275fb3d9e463f60b (diff) |
other: Update git hook
Diffstat (limited to '.githooks')
-rwxr-xr-x | .githooks/update | 4 |
1 files changed, 4 insertions, 0 deletions
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) |