Fix Error 500 when creating a merge request that contains an image that was deleted and added
What does this MR do?
This MR fixes an Error 500 when creating a merge request that contains an image that was deleted and added. Before, when displaying the before and after image, the code would always retrieve the image from the parent commit. However, in a diff, this could cause two different problems:
- The "before" image may not actually be the image you want to compare against (regression of gitlab-org/gitlab-ce#14327)
- It may appear as though a file was modified when it was really just added during the diff
Are there points in the code the reviewer needs to double check?
There may be a more elegant to fix this bug.
Why was this MR needed?
Because a number of users were unable to create merge requests
What are the relevant issue numbers?
#3893 (closed), gitlab-org/gitlab-ee#678
Does this MR meet the acceptance criteria?
-
CHANGELOG entry added -
Tests -
Added for this feature/bug -
All builds are passing
-
-
Conform by the style guides -
Branch has no merge conflicts with master
(if you do - rebase it please) -
Squashed related commits together