lint: Remove travis env var from commit linter

This commit is contained in:
Fabian Jahr 2020-08-04 01:23:46 +02:00
parent a78742830a
commit 72351784b3
No known key found for this signature in database
GPG key ID: F13D1E9D890798CD

View file

@ -14,20 +14,21 @@ while getopts "?" opt; do
case $opt in case $opt in
?) ?)
echo "Usage: $0 [N]" echo "Usage: $0 [N]"
echo " TRAVIS_COMMIT_RANGE='<commit range>' $0" echo " COMMIT_RANGE='<commit range>' $0"
echo " $0 -?" echo " $0 -?"
echo "Checks unmerged commits, the previous N commits, or a commit range." echo "Checks unmerged commits, the previous N commits, or a commit range."
echo "TRAVIS_COMMIT_RANGE='47ba2c3...ee50c9e' $0" echo "COMMIT_RANGE='47ba2c3...ee50c9e' $0"
exit ${EXIT_CODE} exit ${EXIT_CODE}
;; ;;
esac esac
done done
if [ -z "${TRAVIS_COMMIT_RANGE}" ]; then if [ -z "${COMMIT_RANGE}" ]; then
if [ -n "$1" ]; then if [ -n "$1" ]; then
TRAVIS_COMMIT_RANGE="HEAD~$1...HEAD" COMMIT_RANGE="HEAD~$1...HEAD"
else else
TRAVIS_COMMIT_RANGE="origin/master..HEAD" MERGE_BASE=$(git merge-base HEAD master)
COMMIT_RANGE="$MERGE_BASE..HEAD"
fi fi
fi fi
@ -41,6 +42,6 @@ while IFS= read -r commit_hash || [[ -n "$commit_hash" ]]; do
EXIT_CODE=1 EXIT_CODE=1
fi fi
done < <(git log --format=%B -n 1 "$commit_hash") done < <(git log --format=%B -n 1 "$commit_hash")
done < <(git log "${TRAVIS_COMMIT_RANGE}" --format=%H) done < <(git log "${COMMIT_RANGE}" --format=%H)
exit ${EXIT_CODE} exit ${EXIT_CODE}