From f84c7aaec1448eaa5d065cf643cbc8479aeb5ee0 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Thu, 24 May 2018 17:19:22 +0200 Subject: [PATCH] clean/reset git repo before switching branches and building --- gitlab-ci-git-buildpackage | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gitlab-ci-git-buildpackage b/gitlab-ci-git-buildpackage index f4c52bc..38c7f29 100755 --- a/gitlab-ci-git-buildpackage +++ b/gitlab-ci-git-buildpackage @@ -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"