diff --git a/gitlab-ci-git-buildpackage b/gitlab-ci-git-buildpackage index 4124e9f..901fd6b 100755 --- a/gitlab-ci-git-buildpackage +++ b/gitlab-ci-git-buildpackage @@ -20,10 +20,9 @@ if [[ ! -f $lockfile ]] ; then build-essential dpkg-dev fakeroot git-buildpackage pristine-tar $BUILD_DEPENDS apt-get -qy autoremove --purge dpkg-checkbuilddeps - echo "ensure pristine-tar branch exists" - git branch -a - git remote -v - git branch --track pristine-tar origin/pristine-tar || true + echo "ensure pristine-tar branch exists and is current" + git fetch --all || true + 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" if [ -z "$CI_COMMIT_TAG" ]; then