Skip to content

Fix helper to only list conflicts when source/target branch exists

What does this MR do and why?

When source/target branch is deleted the MergeRequests::Conflicts::ListService call will fail because it requires for both source/target branch to exists. This can result to the MR changes tab not loading when there are conflicts.

To fix that, we check if source/target branch exists before making the call.

The call for DiffHelper#conflicts is behind the display_merge_conflicts_in_diff feature flag.

How to set up and validate locally

  1. Create a MR with conflicts.
  2. Delete the source branch.
  3. View the MR changes and it should still load.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #383326 (closed)

Merge request reports