diff options
author | Stan Hu <stanhu@gmail.com> | 2016-08-28 06:59:48 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-11-14 17:57:01 +0300 |
commit | 0f61bb2dc5298a7e06f8e211adcf46dd282b9c86 (patch) | |
tree | 3e5d555919ae02c30bb8519cc898d8a256f75e9a /app/views/projects/diffs/_content.html.haml | |
parent | 36fa5d660df96c49484cd27695da1df6e361eb8f (diff) |
Fix Error 500 when creating a merge request that contains an image that was deleted and added
Steps to reproduce:
1. Start with a repo with an image
2. Add a commit to delete the image
3. Add another commit to replace the image with another image
In a diff comparison, we really just compare about what the image was before the diff, not
the direct parent of the last commit. This MR fixes that.
Closes #3893, gitlab-org/gitlab-ee#678
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'app/views/projects/diffs/_content.html.haml')
-rw-r--r-- | app/views/projects/diffs/_content.html.haml | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/views/projects/diffs/_content.html.haml b/app/views/projects/diffs/_content.html.haml index c3d2f80544b..6120b2191dd 100644 --- a/app/views/projects/diffs/_content.html.haml +++ b/app/views/projects/diffs/_content.html.haml @@ -25,7 +25,7 @@ - elsif diff_file.renamed_file .nothing-here-block File moved - elsif blob.image? - - old_blob = diff_file.old_blob(diff_commit) + - old_blob = diff_file.old_blob(diff_file.old_content_commit || @base_commit) = render "projects/diffs/image", diff_file: diff_file, old_file: old_blob, file: blob - else .nothing-here-block No preview for this file type |