From 2d2efc4f7360b194cd0249924ce37e4210b2fef9 Mon Sep 17 00:00:00 2001 From: Sean McGinnis Date: Fri, 20 Oct 2017 06:14:09 -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: I5d1f6a997375743bb3498e7fae1fbad19c307d33 --- tools/clone_repo.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/clone_repo.sh b/tools/clone_repo.sh index a3648403fd..15a764e31f 100755 --- a/tools/clone_repo.sh +++ b/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