Bug: Diff includes changes from the base branch

Summary

When pointing an MR at branch other than master, the diff sometimes includes changes from the base branch.

!27360 (diffs)

Steps to reproduce

Merge off master to create branch-1.

Open an MR based on branch-1.

Merge off branch-1 to create branch-2 and open an MR. At this point the diff does not include changes from branch-1.

Make some changes to branch-1 rebase master into branch-1 and push up branch-1.

Rebase branch-1 into branch-2.

At this point the MR no longer shows the correct diff between branch-1 and branch-2

Example Project

!27360 (diffs)

but I have seen this happen frequently. It seems to only happen after changes are made to the base branch and then the base branch is rebased on top of the new feature branch.

What is the current bug behavior?

Diff does not match what git generates between the two branches and instead includes changes from the base branch.

What is the expected correct behavior?

Diff should match the diff generated by git.

Relevant logs and/or screenshots

Diff on gitlab.com:

FireShot_Capture_005_-WIP__Add_Scheduled_Job_for_Monitoring_Monitor_Group_Demo_Environments_-_gitlab.com

Diff file generated locally with my ab-monitor-demo-environments and my ab-monitor-demo-environments-2 up to date with the remote branches (generated via git diff ab-monitor-demo-environments > diff_file)

diff_file

So it should be a change to 4 files rather than 11.

Edited by Allison Browne (PTO 12/19-1/2)