Add a "patch" MIME type, and render it like a normal view in Commit#show

This commit is contained in:
Robert Speicher 2012-09-25 18:46:19 -04:00
parent c058e3903e
commit 99d391332f
4 changed files with 17 additions and 22 deletions

View file

@ -15,19 +15,22 @@ class CommitController < ApplicationController
result = CommitLoad.new(project, current_user, params).execute
@commit = result[:commit]
git_not_found! unless @commit
if @commit
@suppress_diff = result[:suppress_diff]
@note = result[:note]
@line_notes = result[:line_notes]
@notes_count = result[:notes_count]
@comments_allowed = true
else
return git_not_found!
end
@suppress_diff = result[:suppress_diff]
@note = result[:note]
@line_notes = result[:line_notes]
@notes_count = result[:notes_count]
@comments_allowed = true
if result[:status] == :huge_commit
render "huge_commit" and return
respond_to do |format|
format.html do
if result[:status] == :huge_commit
render "huge_commit" and return
end
end
format.patch
end
end
end