From d43b8ccede548ba09c630d2d8838b39f53f35558 Mon Sep 17 00:00:00 2001 From: Sean McGinnis Date: Fri, 20 Oct 2017 06:19:15 -0500 Subject: [PATCH] Default clone_repo to master if branch not found Behavior change from set -e causes attempt to checkout an invalid branch to fail. Explicitly fall back to master if the requested branch name checkout fails. Change-Id: Ib20a4910275126fc3949b06dbc91a301c2d04406 --- jenkins/scripts/release-tools/clone_repo.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkins/scripts/release-tools/clone_repo.sh b/jenkins/scripts/release-tools/clone_repo.sh index a3648403fd..15a764e31f 100755 --- a/jenkins/scripts/release-tools/clone_repo.sh +++ b/jenkins/scripts/release-tools/clone_repo.sh @@ -169,6 +169,6 @@ else # directory already existed we might have checked out something else # before so just do it again). (cd $local_dir && - git checkout $BRANCH && + (git checkout $BRANCH || git checkout master) && git pull --ff-only) fi