Confusing/Incorrect branch shown on merge request after rebase/force push

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Summary

Activity section of MR Overview shows incorrect branch details when listing a summary

Visible on this merge request

Steps to reproduce

I've replicated this in https://gitlab.com/simonstreet_ultimate_group/public/zd-553245-master - although it took a few attempts so the history may be a bit confusing.

  • Have a project with master and develop at the same point (for this replication master was one commit ahead of develop where it was merged to bring them in line)
  • Default branch should be develop
  • Create two branches, conflict1 and conflict2 based on master
    • git checkout master; git checkout -b conflict1; git checkout master; git checkout -b conflict2
  • Create a change on conflict2, push it, create and merge a MR for conflict2 -> develop
  • Create and merge a MR for develop -> master
  • Create a change on conflict1, push it, create and merge a MR for conflict1 -> develop
    • git checkout conflict1; echo conflict1 > conflictfile; git add conflictfile; git commit -m 'confilict'; git push origin conflict1
    • simonstreet_ultimate_group/public/zd-553245-master!11 (NB: this MR has had the following steps performed to it, but you would see a conflict here due to the changes from conflict2 we merged earlier
  • Perform the following to rebase master against conflict1 and force push to conflict1 to resolve the conflict
    • git checkout master; git pull
    • git checkout conflict1; git rebase origin/master - conflict warning about conflictfile
    • git add conflictfile
    • git rebase --continue (prompted for commit message, accepted default)
    • git push origin conflict1 (failed)
    • git push origin conflict1 --force
  • View the MR and observe that the Activity section labels the commits that were merged from master as coming from develop

Screenshot_2024-10-14_at_15.05.02

Example Project

https://gitlab.com/simonstreet_ultimate_group/public/zd-553245-master

What is the current bug behavior?

Activity summary links to wrong branch

What is the expected correct behavior?

Activity summary links to correct branch

Relevant logs and/or screenshots

Screenshot above

Output of checks

Happens on GitLab.com

Results of GitLab environment info

n/a

Results of GitLab application Check

n/a

Possible fixes

n/a

Edited by 🤖 GitLab Bot 🤖