squash commit issue when merge branch to another branch

Summary

A conflict occurs during the merge if the previous one was with squash

Steps to reproduce

I have 2 branches. main and staging. I change several files and make several commits. I push them to main. Then I create a merge request from main to staging, I activate the checkbox "Squash commits when merge request is accepted.". Then I apply merge request. Everything worked fine.

Then, in the main branch, I again change the same line in one of the files in which there were changes earlier. I do push in main. Now I create a new merge request from main to staging. Checkbox "Squash commits when merge request is accepted." I don't activate. I get conflict. When I look at the changes. Gitlab shows that several files have been changed and a conflict in a line in one file. For some reason, gitlab does not create a new merge commit, but merges it with the previous one and therefore gets a conflict, because it thinks that the same line has been changed. Is this normal behavior? I think not. If it's a bug, then it needs to be fixed because I can't get a clean commit history on the internship branch.

Example Project

I created new project with this problem https://gitlab.com/dotmitsu/merge-conflict-test/-/merge_requests/2

What is the current bug behavior?

I get conflict.

What is the expected correct behavior?

I shouldn't get conflict

Relevant logs and/or screenshots

I don't think screenshots are needed, because I attached a link with a project created from scratch and with a repeat of the error.

Output of checks

This bug happens on GitLab.com

Edited by dotmitsu