From 5a11970d630c407d76550edc6d436305d54ba521 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Fri, 25 Sep 2015 08:39:13 +0100 Subject: [PATCH] travis.yml: try to refetch PR commit if missing. --- .travis.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index cc3b2dbdf1784..8c35963561539 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,14 +16,15 @@ matrix: rvm: system before_install: - - sudo rm -rf /usr/local/.git + - sudo rm -rf /usr/local/.git/refs /usr/local/.git/packed-refs - sudo rsync -az "$TRAVIS_BUILD_DIR/" /usr/local/ - export TRAVIS_BUILD_DIR="/usr/local" - sudo chown -R $USER /usr/local - cd /usr/local - env | grep TRAVIS_ - if [ -f ".git/shallow" ]; then travis_retry git fetch --unshallow; fi - - git reset --hard $TRAVIS_COMMIT + - if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then git reset --hard $TRAVIS_COMMIT || travis_retry git fetch origin +refs/pull/$TRAVIS_PULL_REQUEST/merge:; fi + - if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then git reset --hard $TRAVIS_COMMIT; fi - git clean -qxdff script: