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
- Create a MR with conflicts.
- Delete the source branch.
- 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.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #383326 (closed)