Merged with squash commit does not add 'merged' label and results in incorected commits behind/ahead

Summary

When merging a merge request with the squash commit option, the source branch does not get the label 'merged' Also, the commits behind and ahead shows an incorrect number. For example, I squash 2 commits, the source branch is now 2 commits behind and ahead of the target branch. When comparing source and target, it seems like the commits are not made to the target. When checking the source of the target, the commits are there.

Steps to reproduce

  • Create a repo with a readme.
  • Create a new branch.
  • Make a number commits to the new branch.
  • Create a merge request for the new branch with the 'Squash commits' option enabled.
  • Merge the merge request.

Example Project

In this example project I performed the steps above. https://gitlab.com/robindijkhof/robintest

What is the current bug behavior?

  • The label 'merged' is not added [1].
  • The source branch is 2 commits behind and 2 commits ahead [1]
  • When comparing source and target it seems the commits are not merged to target [2].

[1]https://gitlab.com/robindijkhof/robintest/-/branches [2]robindijkhof/robintest@master...terst

What is the expected correct behavior?

The label merged should be added. The source branch should not be 2 commits ahead and behind. When comparing the branches, there shouldn't be any difference.

Output of checks

This bug happens on GitLab.com

Assignee Loading
Time tracking Loading