diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:14:33 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:14:33 +0000 |
commit | 9f153fbfec0fb9c9ce38e749a7c6f4a5e115d4e9 (patch) | |
tree | 2784370cda9bbf2da9114d70f05399c0b229d28c /tools/validate-commit.py | |
parent | Adding debian version 4.2.6-1. (diff) | |
download | wireshark-9f153fbfec0fb9c9ce38e749a7c6f4a5e115d4e9.tar.xz wireshark-9f153fbfec0fb9c9ce38e749a7c6f4a5e115d4e9.zip |
Merging upstream version 4.4.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tools/validate-commit.py')
-rwxr-xr-x | tools/validate-commit.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tools/validate-commit.py b/tools/validate-commit.py index cf4980be..b5d85afe 100755 --- a/tools/validate-commit.py +++ b/tools/validate-commit.py @@ -19,7 +19,6 @@ import json import os import subprocess import sys -import tempfile import urllib.request import re @@ -190,6 +189,14 @@ def verify_merge_request(): print("This doesn't appear to be a merge request. CI_MERGE_REQUEST_PROJECT_ID={}, CI_MERGE_REQUEST_IID={}".format(project_id, m_r_iid)) return True + m_r_sb_protected = os.getenv('CI_MERGE_REQUEST_SOURCE_BRANCH_PROTECTED') + if m_r_sb_protected == 'true': + print(f'''\ +You're pushing from a protected branch ({os.getenv('CI_MERGE_REQUEST_SOURCE_BRANCH_NAME')}). You will probably +have to close this merge request and push from a different branch.\n +''') + # Assume that the "Allow commits" test is about to fail. + m_r_url = '{}/projects/{}/merge_requests/{}'.format(gitlab_api_pfx, project_id, m_r_iid) req = urllib.request.Request(m_r_url) # print('req', repr(req), m_r_url) @@ -219,8 +226,8 @@ def main(): try: with open(args.commitmsg) as f: return 0 if verify_body(f.read()) else 1 - except: - print("Couldn't verify body of message from file '", + args.commitmsg + "'"); + except Exception: + print("Couldn't verify body of message from file '", + args.commitmsg + "'") return 1 |