mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-18 12:53:03 +02:00
lint: Use TRAVIS_BRANCH in lint-git-commit-check.sh
This commit is contained in:
parent
c11dc995c9
commit
a91ab86fae
@ -23,10 +23,18 @@ while getopts "?" opt; do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# TRAVIS_BRANCH will be present in a Travis environment. For builds triggered
|
||||||
|
# by a pull request this is the name of the branch targeted by the pull request.
|
||||||
|
# https://docs.travis-ci.com/user/environment-variables/
|
||||||
|
if [ -n "${TRAVIS_BRANCH}" ]; then
|
||||||
|
COMMIT_RANGE="$TRAVIS_BRANCH..HEAD"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -z "${COMMIT_RANGE}" ]; then
|
if [ -z "${COMMIT_RANGE}" ]; then
|
||||||
if [ -n "$1" ]; then
|
if [ -n "$1" ]; then
|
||||||
COMMIT_RANGE="HEAD~$1...HEAD"
|
COMMIT_RANGE="HEAD~$1...HEAD"
|
||||||
else
|
else
|
||||||
|
# This assumes that the target branch of the pull request will be master.
|
||||||
MERGE_BASE=$(git merge-base HEAD master)
|
MERGE_BASE=$(git merge-base HEAD master)
|
||||||
COMMIT_RANGE="$MERGE_BASE..HEAD"
|
COMMIT_RANGE="$MERGE_BASE..HEAD"
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user