Download button is shown instead of diff in merge request

Summary

When using single-file view mode, two download buttons are displayed instead of a diff when selecting a file in the Changes section of a merge request.

Steps to reproduce

  1. Start with single file view mode disabled
  2. Open a merge request that contains large changes.
  3. Find one or more files that display Files with large changes are collapsed by default. instead of a diff
  4. Enable single file view mode
  5. Select the file identified in the tree view

Download buttons are displayed instead of a diff,

Example Project

PeteAndersen/diff-issue-demo!1

What is the current bug behavior?

Selecting the file in the tree displays a view with 2 download buttons instead of a diff.

What is the expected correct behavior?

Diff should be displayed right away in single file view mode

Relevant logs and/or screenshots

Type of file that causes the issue (single-file view mode disabled):

image

In single file view mode, collapse and expand returns a valid diff:

download_instead_of_diff

Output of checks

This bug happens on GitLab.com

Results of GitLab environment info

N/A

Results of GitLab application Check

N/A

Possible fixes

Edited by Peter