After reworking history merge request fails to display diff
Follow up of test described in #76 (closed) #75 (closed)
Getting a a 500 error on https://forge.extranet.logilab.fr/arthur/test-45-bis/merge_requests/1/diffs.json
Which fits the log :
heptapod_1 | ActionView::Template::Error (undefined method `[]' for nil:NilClass):
heptapod_1 | 19: - if image_diff && image_replaced
heptapod_1 | 20: = view_file_button(diff_file.old_content_sha, diff_file.old_path, project, replaced: true)
heptapod_1 | 21:
heptapod_1 | 22: = view_file_button(diff_file.content_sha, diff_file.file_path, project)
heptapod_1 | 23: = view_on_environment_button(diff_file.content_sha, diff_file.file_path, environment) if environment
heptapod_1 | 24:
heptapod_1 | 25: = render 'projects/diffs/content', diff_file: diff_file
heptapod_1 | app/models/commit.rb:56:in `truncate_sha'
heptapod_1 | app/helpers/commits_helper.rb:205:in `truncate_sha'
heptapod_1 | app/helpers/commits_helper.rb:188:in `block in view_file_button'
heptapod_1 | app/helpers/commits_helper.rb:182:in `view_file_button'
heptapod_1 | app/views/projects/diffs/_file.html.haml:22:in `_app_views_projects_diffs__file_html_haml___3076613447510380072_70280453495560'
heptapod_1 | app/views/projects/diffs/_diffs.html.haml:28:in `_app_views_projects_diffs__diffs_html_haml__157936265056291898_70280447866200'
heptapod_1 | app/views/projects/merge_requests/diffs/_diffs.html.haml:3:in `_app_views_projects_merge_requests_diffs__diffs_html_haml___4544012769722902036_70280442315040'
heptapod_1 | app/controllers/application_controller.rb:268:in `view_to_html_string'
heptapod_1 | app/controllers/projects/merge_requests/diffs_controller.rb:15:in `block in show'
heptapod_1 | lib/gitlab/gitaly_client.rb:193:in `allow_n_plus_1_calls'
heptapod_1 | app/controllers/projects/merge_requests/diffs_controller.rb:14:in `show'
heptapod_1 | lib/gitlab/i18n.rb:47:in `with_locale'
heptapod_1 | lib/gitlab/i18n.rb:53:in `with_user_locale'
heptapod_1 | app/controllers/application_controller.rb:346:in `set_locale'
heptapod_1 | lib/gitlab/middleware/multipart.rb:93:in `call'
heptapod_1 | lib/gitlab/request_profiler/middleware.rb:14:in `call'
heptapod_1 | lib/gitlab/middleware/go.rb:17:in `call'
heptapod_1 | lib/gitlab/etag_caching/middleware.rb:11:in `call'
heptapod_1 | lib/gitlab/middleware/read_only.rb:30:in `call'
heptapod_1 | lib/gitlab/request_context.rb:18:in `call'
heptapod_1 | lib/gitlab/metrics/requests_rack_middleware.rb:27:in `call'
Sentry logs (need account to view) :