500 Error when viewing commit list, if git color.ui is enabled
Created by: mdutton3
The commit page for a project (i.e. /RepoName/commits/branch
) will return a 500
error if git is configured to show logs in color.
GitLab v3.1.0 git v1.7.9.5
Steps to reproduce:
- Make a repository with some commit data
- Enable color in git (e.g. as gitlab user, run
git config --global color.ui always
) - Try to view the commit list (e.g. http://gitlab.foo.com/TestRepo/commits/master)
Excerpt of gitlab/log/production.log: Started GET "/TestRepo/commits/master" for 127.0.0.1 at 2012-12-03 16:58:58 -0500 Processing by CommitsController#show as HTML Parameters: {"project_id"=>"TestRepo", "id"=>"master"} Completed 500 Internal Server Error in 236ms
NoMethodError (undefined method `split' for nil:NilClass):
app/models/commit.rb:64:in `commits'
app/roles/repository.rb:32:in `commits'
app/controllers/commits_controller.rb:15:in `show'
From my initial debugging, this looks to be caused by grit, which doesn't expect color codes in the log output that it is trying to parse.