mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-21 14:34:49 +01:00
lint: specify the right commit range when running locally
When running lints on Cirrus, a special envvar is set ($CIRRUS_PR); emulate this when running linters locally by setting $LOCAL_BRANCH to any value.
This commit is contained in:
parent
dff7ed5732
commit
b68e5a7fef
2 changed files with 6 additions and 2 deletions
|
@ -6,7 +6,11 @@
|
||||||
|
|
||||||
export LC_ALL=C
|
export LC_ALL=C
|
||||||
|
|
||||||
if [ -n "$CIRRUS_PR" ]; then
|
if [ -n "$LOCAL_BRANCH" ]; then
|
||||||
|
# To faithfully recreate CI linting locally, specify all commits on the current
|
||||||
|
# branch.
|
||||||
|
COMMIT_RANGE="$(git merge-base HEAD master)..HEAD"
|
||||||
|
elif [ -n "$CIRRUS_PR" ]; then
|
||||||
COMMIT_RANGE="HEAD~..HEAD"
|
COMMIT_RANGE="HEAD~..HEAD"
|
||||||
echo
|
echo
|
||||||
git log --no-merges --oneline "$COMMIT_RANGE"
|
git log --no-merges --oneline "$COMMIT_RANGE"
|
||||||
|
|
|
@ -6,7 +6,7 @@ export LC_ALL=C
|
||||||
git config --global --add safe.directory /bitcoin
|
git config --global --add safe.directory /bitcoin
|
||||||
|
|
||||||
if [ -z "$1" ]; then
|
if [ -z "$1" ]; then
|
||||||
bash -ic "./ci/lint/06_script.sh"
|
LOCAL_BRANCH=1 bash -ic "./ci/lint/06_script.sh"
|
||||||
else
|
else
|
||||||
exec "$@"
|
exec "$@"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Reference in a new issue