Check for branches in zuulv3 git repos properly

Zuulv3 git repos do not have remotes. git_has_branch checks if the
branch exists in the origin remote which does not exist so all branch
specific checkouts were falling back to master which caused job
failures.

Instead just check if the base branch name exists in the repo as that
existing in a zuulv3 repo is sufficient to know we are up to date.

Depends-On: I110879bac5d8a671d73fab906ffbcf8156b1135d
Change-Id: Ifcae3ff217259926a8950f6da83212ee311002b2
This commit is contained in:
Clark Boylan 2017-09-30 09:35:34 -07:00 committed by Clark Boylan
parent 3d915fe3aa
commit 38638e8fd1
1 changed files with 1 additions and 1 deletions

View File

@ -413,7 +413,7 @@ function setup_workspace {
cd $DEST
rsync -a ~/src/*/${PROJECT}/ `basename $PROJECT`
cd `basename $PROJECT`
if git_has_branch ${PROJECT} $base_branch; then
if git branch -a | grep "$base_branch" > /dev/null ; then
git checkout $base_branch
else
git checkout master