Listing the "Files" of a repo that has no README file gives error 500
Created by: AlyBadawy
hello, I have been seeing the "Error 500" for some of the repositories that I host on my gitlab since upgrading to 6.4.x when trying to list the "files" of those repositories.
I have traced the production log and saw the following:
Started GET "/finish/finish/tree/0e50e6d10b5d7a5dbb83cd7b8e8952c337976586" for 127.0.0.1 at 2013-12-28 17:13:52 +0000
Processing by Projects::TreeController#show as HTML
Parameters: {"project_id"=>"finish/finish", "id"=>"0e50e6d10b5d7a5dbb83cd7b8e8952c337976586"}
Rendered shared/_ref_switcher.html.haml (2.3ms)
Rendered projects/tree/_tree_item.html.haml (7.8ms)
Rendered projects/tree/_blob_item.html.haml (4.2ms)
Rendered projects/tree/_readme.html.haml (1.2ms)
Rendered projects/tree/_tree.html.haml (15.4ms)
Rendered projects/tree/show.html.haml within layouts/projects (18.3ms)
Completed 500 Internal Server Error in 199ms
ActionView::Template::Error (wrong number of arguments (0 for 1..2)):
10: %pre.clean
11: = readme.data
12: - else
13: = raw GitHub::Markup.render(readme.name, readme.data)
app/views/projects/tree/_readme.html.haml:13:in `_app_views_projects_tree__readme_html_haml___3911765076416032807_70033275204560'
app/views/projects/tree/_tree.html.haml:49:in `_app_views_projects_tree__tree_html_haml__1790855601822954723_70033267986920'
app/views/projects/tree/show.html.haml:4:in `_app_views_projects_tree_show_html_haml___2664623310469250148_70033240800140'
app/controllers/projects/tree_controller.rb:6:in `show'
app/controllers/application_controller.rb:57:in `set_current_user_for_thread'
I thought the error is because the repo is missing a README file, when I added the file and pushed, the error disappeared.
I believe this error should be handled, and not threw an exception for no README file.