Fix git checkout

If the branch does not exist locally, create it properly.
Otherwise the script will abort with freshly checkout sources.

Change-Id: I05960ed862fa61f3c9435f6749d941128812887b
This commit is contained in:
Andreas Jaeger 2014-09-07 10:41:49 +02:00
parent 0d91133bef
commit 9ec7a6f6c1
1 changed files with 6 additions and 1 deletions

View File

@ -154,7 +154,12 @@ if [ "$FAST" -eq 0 ] ; then
(
cd $SOURCESDIR/$project
git checkout $BRANCH
GIT_CMD="git show-ref --verify --quiet refs/heads/$BRANCH"
if $GIT_CMD; then
git checkout $BRANCH
else
git checkout -b $BRANCH remotes/origin/$BRANCH
fi
python setup.py install
)
done