From 7affd5fcff5eb76c8852127136f0148bf9246506 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Thu, 20 Dec 2018 22:13:40 +0000 Subject: [PATCH] Try fetching more branches for PRs Attempt both the PR author's branch and the PR's target branch. This resolves issues on experimental where we need riot-web to also be experimental. --- scripts/fetchdep.sh | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/scripts/fetchdep.sh b/scripts/fetchdep.sh index 73c622133b..f20bfe8920 100755 --- a/scripts/fetchdep.sh +++ b/scripts/fetchdep.sh @@ -1,22 +1,24 @@ #!/bin/sh -set -e - org="$1" repo="$2" rm -r "$repo" || true -curbranch="$TRAVIS_PULL_REQUEST_BRANCH" -[ -z "$curbranch" ] && curbranch="$TRAVIS_BRANCH" -[ -z "$curbranch" ] && curbranch=`"echo $GIT_BRANCH" | sed -e 's/^origin\///'` # jenkins +clone() { + branch=$1 + if [ -n "$branch" ] + then + echo "Trying to use the branch $branch" + git clone https://github.com/$org/$repo.git $repo --branch "$branch" && exit 0 + fi +} -if [ -n "$curbranch" ] -then - echo "Determined branch to be $curbranch" - - git clone https://github.com/$org/$repo.git $repo --branch "$curbranch" && exit 0 -fi - -echo "Checking out develop branch" -git clone https://github.com/$org/$repo.git $repo --branch develop +# Try the PR author's branch in case it exists on the deps as well. +clone $TRAVIS_PULL_REQUEST_BRANCH +# Try the target branch of the push or PR. +clone $TRAVIS_BRANCH +# Try the current branch from Jenkins. +clone `"echo $GIT_BRANCH" | sed -e 's/^origin\///'` +# Use develop as the last resort. +clone develop