Fix branch already exists in drone (#276)

This commit is contained in:
Bill Maxwell 2016-09-09 12:50:32 -07:00 committed by GitHub
parent 95c24738db
commit 855af340f7

View File

@ -6,7 +6,7 @@ cd $(dirname $0)/..
trap "rm -rf /scratch/*" exit
GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
if [ -n "${DRONE_BRANCH}" ]; then
if [ -n "${DRONE_BRANCH}" ] && [ "${DRONE_BRANCH}" != "${GIT_BRANCH}" ]; then
git checkout -b ${DRONE_BRANCH}
GIT_BRANCH=${DRONE_BRANCH}
fi