Diff views not working for some merge requests
Created by: tul
Hi there,
I have a problem with the diff view for merge requests. I noticed this problem recently on my gitlab 2.6.3 install. I have updated to v 2.8.2 and the problem still exists.
If you click the diff tab for a merge request, instead of getting a diff, I get nothing. The production.log reports:
Started GET "/cob/notes.js?last_id=0&target_type=commit&arget_id=c499beba36b2552508ffef1db841a8ea4a9ebcb4&=1347268461312" for 127.0.0.1 at 2012-09-10 10:12:26 +0100 Processing by NotesController#index as JS Parameters: {"last_id"=>"0", "target_type"=>"commit", "target_id"=>"c499beba36b2552508ffef1db841a8ea4a9ebcb4", ""=>"1347268461312", "project_id"=>"cob"} Rendered commits/_text_file.html.haml (17.0ms) Rendered notes/_load.js.haml (1.2ms) Rendered notes/index.js.haml (1.6ms) Completed 200 OK in 11ms (Views: 2.4ms | ActiveRecord: 0.6ms) Rendered commits/_text_file.html.haml (2.8ms) Rendered commits/_text_file.html.haml (22.5ms) Rendered commits/_text_file.html.haml (15.1ms) Rendered commits/_text_file.html.haml (30.7ms) Rendered commits/_text_file.html.haml (8.1ms) Rendered commits/_text_file.html.haml (99.0ms) Rendered commits/_text_file.html.haml (54.0ms) Rendered commits/_text_file.html.haml (41.9ms) Rendered commits/_text_file.html.haml (3.8ms) Rendered commits/_text_file.html.haml (7.7ms) Rendered commits/_text_file.html.haml (27.6ms) Rendered commits/_text_file.html.haml (2.1ms) Rendered commits/_text_file.html.haml (97.3ms) Rendered commits/_text_file.html.haml (7.3ms) Rendered commits/_text_file.html.haml (84.2ms) Rendered commits/_text_file.html.haml (29.5ms) Rendered commits/_text_file.html.haml (3.1ms) Rendered commits/_text_file.html.haml (7.7ms) Rendered commits/_text_file.html.haml (125.7ms) Rendered commits/_text_file.html.haml (30.5ms) Rendered commits/_text_file.html.haml (166.3ms) Rendered commits/_text_file.html.haml (4.9ms) Rendered commits/_text_file.html.haml (3.8ms) Rendered commits/_text_file.html.haml (8.5ms) Rendered commits/_diffs.html.haml (3058.6ms) Rendered merge_requests/show/_diffs.html.haml (3058.8ms) Rendered merge_requests/diffs.js.haml (3059.2ms) Completed 500 Internal Server Error in 3084ms ActionView::Template::Error (undefined method
empty?' for nil:NilClass): 14: 15: - unless @suppress_diff 16: - diffs.each_with_index do |diff, i| 17: - next if diff.diff.empty? 18: - file = (@commit.tree / diff.new_path) 19: - file = (@commit.prev_commit.tree / diff.old_path) unless file 20: - next unless file app/views/commits/_diffs.html.haml:17:in
block in _app_views_commits__diffs_html_haml__4419008858835936829_77362960' app/views/commits/_diffs.html.haml:16:ineach' app/views/commits/_diffs.html.haml:16:in
each_with_index' app/views/commits/_diffs.html.haml:16:in_app_views_commits__diffs_html_haml__4419008858835936829_77362960' app/views/merge_requests/show/_diffs.html.haml:2:in
_app_views_merge_requests_show__diffs_html_haml__4105227601523992256_77432700' app/views/merge_requests/diffs.js.haml:2:in `_app_views_merge_requests_diffs_js_haml___1423933660522566378_77483020'
Diff views for other merge requests on other projects on the same server appear to work fine. Perhaps it is something related to the type of files in the diff? I can provide additional info if someone can tell me what is needed.
Many thanks,
Mark