'download as' button 'Email patches' or 'Plain diff' fails with 500 error for merge commits
Created by: georgehansper
When viewing the a project commits in gitlab, clicking on a commit-id gives a html colorised view of the diffs that this commit introduces.
This page /mygroup/myproject/commit/abcdef12345...
also has a button labelled Download As
This presents a plain-text version of the diff.
The Download As
feature works for ordinary commits, but fails with an error 500 when viewing a 'merge commit'.
The html colorised diff is viewable – only the Download As
fails with a 500 error.
The relevant log message from production.log
Started GET "/mygroup/myproject/commit/cb59cabcdef12345abcdef12345abcdef12345a9.diff" for 127.0.0.1 at 2015-01-12 14:56:09 +1100
Processing by Projects::CommitController#show as DIFF
Parameters: {"project_id"=>"mygroup/myproject", "id"=>"cb59cabcdef12345abcdef12345abcdef12345a9"}
Completed 500 Internal Server Error in 78ms
Rugged::InvalidError (Commit cb59cabcdef12345abcdef12345abcdef12345a9 is a merge commit):
app/models/commit.rb:129:in `method_missing'
app/controllers/projects/commit_controller.rb:28:in `block (2 levels) in show'
app/controllers/projects/commit_controller.rb:26:in `show'