Skip to content

gitlab-ci-git-buildpackage fails for tags

Hi,

https://salsa.debian.org/games-team/mgba/-/jobs/772741

+ echo 'make debian/0.8.1+dfsg-1 branch current for gbp'
make debian/0.8.1+dfsg-1 branch current for gbp
+ git checkout -B debian/0.8.1+dfsg-1 64666d77b11e7707566f0f97f260d6831d728ec5
Switched to a new branch 'debian/0.8.1+dfsg-1'
+ '[' -z debian/0.8.1+dfsg-1 ']'
+ gbp buildpackage -uc -us --git-pristine-tar
gbp:error: You are not on branch 'master' but on 'debian/0.8.1+dfsg-1'
gbp:error: Use --git-ignore-branch to ignore or --git-debian-branch to set the branch name.

I can see the same failure in other projects as well, for example:

https://salsa.debian.org/auth-team/yubikey-luks/-/jobs/480108

Some projects just make the script not run for tags:

https://sources.debian.org/src/android-platform-system-core/1:8.1.0+r23-7/debian/.gitlab-ci.yml/?hl=16#L11

https://sources.debian.org/src/openssh/1:8.2p1-4/debian/.gitlab-ci.yml/?hl=9#L12

I'm not sure exactly what the intended behaviour is here. git checkout -B should always result in a branch being checked out; I don't believe it ever checks out a detached HEAD.

Would it work to just drop the conditional and always pass --git-debian-branch?

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information