travis: make conditional test coverage analysis work again
MODIFY
.travis.yml
.travis.yml
@@ -73,6 +73,13 @@ matrix:
- go: master
before_install:
+ # Make sure we have the origin master to compare HEADs and
+ # save the sha for comparison in test-coverage.sh.
+ # It is necessary to do this here since the rigmarole for
+ # Windows loses the link to the real origin master.
+ - git fetch --depth=1 origin master
+ - export ORIGIN_MASTER=$(git ls-remote origin master | cut -f1)
+
# This garbage is necessary because on windows, Travis
# helpfully sets core.autocrlf to true.
#

MODIFY
.travis/script.d/test-coverage.sh
.travis/script.d/test-coverage.sh
@@ -5,10 +5,11 @@ if [[ "${TRAVIS_SECURE_ENV_VARS}" != true ]]; then
exit 0
fi
-ORIGIN_MASTER="$(git ls-remote origin master | cut -f1)"
CURRENT="$(git rev-parse HEAD)"
if [[ ${ORIGIN_MASTER} != ${CURRENT} ]]; then
echo "skipping coverage - not merged into master"
+ echo origin/master is ${ORIGIN_MASTER}
+ echo current HEAD is ${CURRENT}
exit 0
fi

travis: make conditional test coverage analysis work again