aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2017-11-26 07:14:58 +0100
committerGitHub <noreply@github.com>2017-11-26 07:14:58 +0100
commit8dd59bd72e47fffc9b7ab6cc91c76903ada363ff (patch)
treef94e774edf8ed71566400fd8799a0e0c12592304
parent203c2dae3cdd255956d5db23d28f241eeca21612 (diff)
parentb24b600287dd64cd170eff53837b34cd17a0cfa5 (diff)
downloadyosys-8dd59bd72e47fffc9b7ab6cc91c76903ada363ff.tar.gz
yosys-8dd59bd72e47fffc9b7ab6cc91c76903ada363ff.tar.bz2
yosys-8dd59bd72e47fffc9b7ab6cc91c76903ada363ff.zip
Merge pull request #461 from mithro/travis-rework
travis: Print branches before fetching, try both locations.
-rwxr-xr-x.travis/setup.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/.travis/setup.sh b/.travis/setup.sh
index 23bdf563f..81ff37742 100755
--- a/.travis/setup.sh
+++ b/.travis/setup.sh
@@ -29,8 +29,16 @@ fi
if [ z"$TRAVIS_BRANCH" != z ]; then
TRAVIS_COMMIT_ACTUAL=$(git log --pretty=format:'%H' -n 1)
echo "- Fixing detached head (current $TRAVIS_COMMIT_ACTUAL -> $TRAVIS_COMMIT)"
- git fetch origin $TRAVIS_COMMIT
+ git remote -v
git branch -v
+ if [ x"$(git show-ref -s HEAD)" = x"$TRAVIS_COMMIT" ]; then
+ echo "Checked out at $TRAVIS_COMMIT"
+ else
+ if [ z"$TRAVIS_PULL_REQUEST_SLUG" != z ]; then
+ git fetch source $TRAVIS_COMMIT || echo "Unable to fetch $TRAVIS_COMMIT from source"
+ fi
+ git fetch origin $TRAVIS_COMMIT || echo "Unable to fetch $TRAVIS_COMMIT from origin"
+ fi
git branch -D $TRAVIS_BRANCH || true
git checkout $TRAVIS_COMMIT -b $TRAVIS_BRANCH
git branch -v