MR Changes view show already-deleted folder when source branch has conflicts
Summary
When the source branch both deletes a folder AND introduces a conflict with the destination branch, both the Merge Request Changes view incorrectly displays the already-deleted folder as a change. This behavior is inconsistent with git diff output, which correctly filters out the deleted folder regardless of MR conflict status.
Steps to Reproduce
- Create a repository with a folder to be deleted
- Create two branches from the same commit:
-
Destination branch (
destination): Delete the folder in one commit -
Source branch (
source-conflict):- Delete the same folder in one commit
- Introduce a conflict with the destination branch in another file
-
Destination branch (
- Create a merge request from
source-conflicttodestination - Navigate to the Changes tab of the merge request
- Observe the diff output in both locations
Public reproduction case available at:
- Project: https://gitlab.com/gl-demo-ultimate-khrechyshkina/tickets/zd693540
- Merge Request: gl-demo-ultimate-khrechyshkina/tickets/zd693540!1 (diffs) && gl-demo-ultimate-khrechyshkina/tickets/zd693540!2 (diffs)
Current Behavior
In MR Changes view:
- Shows deletion of
folder-to-deleteas a change - This occurs even though
folder-to-deleteis not present in either:- Source branch:
source-conflict - Destination branch:
destination
- Source branch:
- The folder was deleted in both branches, but the MR view shows it as a change
Expected Behavior
-
MR Changes view should match
git diffoutput and NOT show the deleted folder regardless of MR introduces conflicting changes or not - Only actual differences between branches should be displayed
- Both features should use the same diff calculation logic
- Deleted folders that don't exist in either branch should not appear in the diff
GitLab Version
- Reproducible on: GitLab.com (confirmed)
Logs/Screenshots
Reproduction Details:
- MR !1: Shows changes correctly (no conflict scenario)
- MR !2: Demonstrates the bug (source branch deletes folder AND introduces conflict)
- Git diff: Produces correct output without showing deleted folder
- Compare Revisions: Also shows the deleted folder incorrectly
Impact
- Severity: Makes branch comparison confusing and obscures actual conflicts
Additional Context
- Customer Impact: Large account with Ultimate tier affected.
Edited by Kate Grechishkina


