We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c11dc99 commit a91ab86Copy full SHA for a91ab86
test/lint/lint-git-commit-check.sh
@@ -23,10 +23,18 @@ while getopts "?" opt; do
23
esac
24
done
25
26
+# TRAVIS_BRANCH will be present in a Travis environment. For builds triggered
27
+# by a pull request this is the name of the branch targeted by the pull request.
28
+# https://docs.travis-ci.com/user/environment-variables/
29
+if [ -n "${TRAVIS_BRANCH}" ]; then
30
+ COMMIT_RANGE="$TRAVIS_BRANCH..HEAD"
31
+fi
32
+
33
if [ -z "${COMMIT_RANGE}" ]; then
34
if [ -n "$1" ]; then
35
COMMIT_RANGE="HEAD~$1...HEAD"
36
else
37
+ # This assumes that the target branch of the pull request will be master.
38
MERGE_BASE=$(git merge-base HEAD master)
39
COMMIT_RANGE="$MERGE_BASE..HEAD"
40
fi
0 commit comments