clean/reset git repo before switching branches and building

This commit is contained in:
Hans-Christoph Steiner 2018-05-24 17:19:22 +02:00
parent 1312254a5d
commit f84c7aaec1
1 changed files with 3 additions and 1 deletions

View File

@ -30,7 +30,9 @@ if [[ ! -f $lockfile ]] ; then
apt-get -qy autoremove --purge
dpkg-checkbuilddeps
echo "ensure pristine-tar branch exists and is current"
git fetch --all || true
git clean -fdx
git reset --hard
git fetch --all
git checkout -B pristine-tar origin/pristine-tar
echo "make $CI_COMMIT_REF_NAME branch current for gbp"
git checkout -B "$CI_COMMIT_REF_NAME" "$CI_COMMIT_SHA"