forked from zulip/zulip
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lint: Fix gitlint test due to non-deterministic git range.
This makes getting the commit SHA non time sensitive by using the range provided by TravisCI.
- Loading branch information
Showing
2 changed files
with
8 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
#!/bin/bash | ||
|
||
# Lints all commit messages that are newer than upstream/master. | ||
# Lint all commit messages that are newer than upstream/master if running | ||
# locally or the commits in the push or PR if in TravisCI. | ||
|
||
# The rules can be found in /.gitlint | ||
|
||
# If this script is running on TravisCI, $UPSTREAM_MASTER would be set to the | ||
# latest HEAD in travis.yml | ||
if [ ! $TRAVIS ]; then | ||
UPSTREAM_MASTER=upstream/master | ||
if [ $TRAVIS ]; then | ||
range=$TRAVIS_COMMIT_RANGE | ||
else | ||
range="upstream/master...HEAD" | ||
fi | ||
|
||
gitlint --commits $UPSTREAM_MASTER...HEAD | ||
gitlint --commits $range |