Просмотр исходного кода

build.sh: if is an existing remote branch, then execute 'git pull' to get the newest version

Karsten Böddeker 8 лет назад
Родитель
Сommit
cd75eb8b14
1 измененных файлов с 5 добавлено и 1 удалено
  1. 5 1
      build.sh

+ 5 - 1
build.sh

@@ -56,7 +56,6 @@ pushd ${MY_DIR} > /dev/null
 
 ### set reasonable defaults for unset environment variables
 [ -n "${AUTOUPDATER}" ] || AUTOUPDATER=${BRANCH}
-# TODO: [ "${BASE}" == "master" ] && BASE="origin/master"
 if [ -n "${BROKEN}" ]; then
 	if [ "${BROKEN}" -eq "1" ]; then
 		export BROKEN
@@ -119,6 +118,11 @@ progress "Checking out GLUON '${BASE}' ..."
 git fetch
 git checkout -q ${BASE}
 [ "$?" -eq "0" ] || abort "Failed to checkout '${BASE}' gluon base version, mimimi." >&2
+git show-ref --verify --quiet refs/remotes/origin/${BASE}
+if [ "$?" -eq "0" ]; then
+	git pull
+	[ "$?" -eq "0" ] || abort "Failed to get newest '${BASE}' in gluon repository, mimimi."
+fi
 GLUON_COMMIT=$(git rev-list --max-count=1 HEAD)