From c7acdca13c0fa370382c3c678910a78566973f70 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Sun, 6 Mar 2022 19:46:41 +0200 Subject: [PATCH 1/2] git fetch origin to fix patchcheck --- .azure-pipelines/posix-steps.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.azure-pipelines/posix-steps.yml b/.azure-pipelines/posix-steps.yml index 2a3680897302ef..29b43e0934472e 100644 --- a/.azure-pipelines/posix-steps.yml +++ b/.azure-pipelines/posix-steps.yml @@ -66,7 +66,9 @@ steps: COMMAND: make - ${{ if eq(parameters.patchcheck, 'true') }}: - - script: ./python Tools/scripts/patchcheck.py --ci true + - script: | + git fetch origin + ./python Tools/scripts/patchcheck.py --ci true displayName: 'Run patchcheck.py' condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest')) From 71a288defe818457abfaf0ee307c95b79997ab99 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Sun, 6 Mar 2022 20:21:37 +0200 Subject: [PATCH 2/2] Exit on error --- Tools/scripts/patchcheck.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Tools/scripts/patchcheck.py b/Tools/scripts/patchcheck.py index 4cab66c8e97bed..a324eafc52b2ab 100755 --- a/Tools/scripts/patchcheck.py +++ b/Tools/scripts/patchcheck.py @@ -130,6 +130,8 @@ def changed_files(base_branch=None): with subprocess.Popen(cmd.split(), stdout=subprocess.PIPE, cwd=SRCDIR) as st: + if st.wait() != 0: + sys.exit(f'error running {cmd}') for line in st.stdout: line = line.decode().rstrip() status_text, filename = line.split(maxsplit=1)