Browse Source

build.sh: force checkout of remote repository

Karsten Böddeker 6 years ago
parent
commit
55132187e7
1 changed files with 4 additions and 3 deletions
  1. 4 3
      build.sh

+ 4 - 3
build.sh

@@ -122,12 +122,13 @@ pushd ${CODE_DIR} > /dev/null
 # check if gluon got modified and bail out if necessary
 [ "$(git status --porcelain)" ] && abort "Local changes to peers directory. Cowardly refusing to update gluon repository." >&2
 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
+	git checkout -B build origin/${BASE}
 	[ "$?" -eq "0" ] || abort "Failed to get newest '${BASE}' in gluon repository, mimimi."
+else
+	git checkout -q ${BASE}
+	[ "$?" -eq "0" ] || abort "Failed to checkout '${BASE}' gluon base version, mimimi." >&2
 fi
 GLUON_COMMIT=$(git rev-list --max-count=1 HEAD)
 popd > /dev/null #${CODE_DIR}