travis: Allow travis builds to access target branches

Because travis builds only fetch a single branch (master) by default,
test-commit-message.sh only had access to commits in the master branch.
In order to fetch the correct branch for our build, we need to run
'git config remote.origin.fetch..' with the target branch's information
before executing git fetch on the repo in before_install.

Now git will always fetch the appropriate branch.
This commit is contained in:
Jonathan Gold
2017-11-18 18:44:12 -05:00
parent cbc3a691b9
commit 5e5bbf4b39

View File

@@ -8,6 +8,7 @@ sudo: true
dist: trusty
before_install:
- sudo apt update
- git config remote.origin.fetch +refs/heads/${TRAVIS_BRANCH}:refs/remotes/origin/${TRAVIS_BRANCH}
- git fetch --unshallow
install: 'make deps'
script: 'make test'