Skip to content

Set default branch after importing repo from Bitbucket Cloud

Madelein van Niekerk requested to merge 27555-set-default-branch into master

What does this MR do and why?

Fixes Import from BitBucket Cloud: commit count not u... (#27555 - closed) whereby the commit count on the project page shows 0 where it should be non-zero.

The fix is to set the default branch after importing the repository which triggers a callback to update the commit count async. The implementation is the same as for the GitHub importer.

Screenshots or screen recordings

Before After
Screenshot_2023-10-26_at_11.46.21 Screenshot_2023-10-26_at_11.50.04

How to set up and validate locally

  1. Checkout master
  2. Import a project (that contains commits on the default branch) from Bitbucket Cloud into gitlab
  3. Go to the project's page and note that it shows 0 commits
  4. Checkout this branch
  5. Re-import the project
  6. Note that the commit count is now non-zero

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #27555 (closed)

Edited by Madelein van Niekerk

Merge request reports