Refactor diff type selection logic

What does this MR do and why?

In order to support comparing diff versions and viewing diff of specific commit, we need to be able to find a specific MergeRequestDiff record (then possibly compare it to another sha) or a Commit.

The existing logic in MergeRequest#first_diffs_slice and MergeRequest#diffs_for_streaming needs to be refactored to support that.

This doesn't include capability to find by diff_id, start_sha, and commit_id yet but this enables us to do that.

MR that implements support comparing versions: !221893 (merged)

References

#466149 (closed)

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #466149 (closed)

Edited by Patrick Bajao

Merge request reports

Loading