Skip to content

Download/archive.zip with a specific commit over API returns last commit of default branch instead

See https://github.com/composer/composer/issues/6369

This was reported as a composer problem, but I think it might actually be a bug in Gitlab instead.

When running composer with --prefer-dist and a version based on a feature branch, then it downloads the wrong archive. As far as I see, the link that composer generates is correct, as shown there by example:

https://gitlab.example/api/v3/projects/my-project/repository/archive.zip?ref=correct-hash

When I download an archive in the UI, I get this URL:

https://gitlab.example/group/project/repository/archive.zip?ref=same-hash