diff --git a/ci/lint/06_script.sh b/ci/lint/06_script.sh index 1f14dd079f1..bc8e65d8e7b 100755 --- a/ci/lint/06_script.sh +++ b/ci/lint/06_script.sh @@ -9,7 +9,12 @@ export LC_ALL=C GIT_HEAD=$(git rev-parse HEAD) if [ -n "$CIRRUS_PR" ]; then COMMIT_RANGE="${CIRRUS_BASE_SHA}..$GIT_HEAD" + echo + git log --no-merges --oneline "$COMMIT_RANGE" + echo test/lint/commit-script-check.sh "$COMMIT_RANGE" +else + COMMIT_RANGE="SKIP_EMPTY_NOT_A_PR" fi export COMMIT_RANGE @@ -34,8 +39,3 @@ if [ "$CIRRUS_REPO_FULL_NAME" = "bitcoin/bitcoin" ] && [ "$CIRRUS_PR" = "" ] ; t ${CI_RETRY_EXE} gpg --keyserver hkps://keys.openpgp.org --recv-keys "${KEYS[@]}" && ./contrib/verify-commits/verify-commits.py; fi - -if [ -n "$COMMIT_RANGE" ]; then - echo - git log --no-merges --oneline "$COMMIT_RANGE" -fi diff --git a/test/lint/lint-git-commit-check.py b/test/lint/lint-git-commit-check.py index a1d03370e85..049104398a8 100755 --- a/test/lint/lint-git-commit-check.py +++ b/test/lint/lint-git-commit-check.py @@ -46,6 +46,8 @@ def main(): commit_range = merge_base + "..HEAD" else: commit_range = os.getenv("COMMIT_RANGE") + if commit_range == "SKIP_EMPTY_NOT_A_PR": + sys.exit(0) commit_hashes = check_output(["git", "log", commit_range, "--format=%H"], universal_newlines=True, encoding="utf8").splitlines() diff --git a/test/lint/lint-whitespace.py b/test/lint/lint-whitespace.py index 3fb5b800133..72b7ebc394d 100755 --- a/test/lint/lint-whitespace.py +++ b/test/lint/lint-whitespace.py @@ -97,6 +97,8 @@ def main(): commit_range = merge_base + "..HEAD" else: commit_range = os.getenv("COMMIT_RANGE") + if commit_range == "SKIP_EMPTY_NOT_A_PR": + sys.exit(0) whitespace_selection = [] tab_selection = []