Automatic branch merges when branch and commit share name?

Does gitlab automatically merge branches when a commit is named after an existing branch in the project?

A user of my company’s gitlab setup has found what seems like a hidden automerge feature, but we are not sure whether this is a feature or a bug.

  1. A user creates a Branch_X branch in their project.
  2. The user pushes a commit into their projects “develop” branch, with the commit name being “Branch_X” (same name as existing branch in their project)
  3. The Branch_X branch appears as merged into the “develop” branch (the “merged” tag appears, and the hover text says “merged into develop”).

We can reproduce the behavior as long as the user pushing the branch_X-named commit is the same as the creator of branch_X. We are curious whether this is a feature or a bug?

We haven’t been able to find a reference to this behavior anywhere, neither the docs, stackoverflow or this forum.
FWIW my company currently uses GitLab Enterprise Edition 13.5.5-ee

Hi @dbarr
I am pretty sure thats not a feature. And I cannot reproduce it on so I assume this UI bug is fixed in newer version.

1 Like