New Feature: Diff patch file export for commit

This commit is contained in:
randx 2012-06-28 12:51:50 +03:00
parent df6b587f34
commit 335f9d6410
4 changed files with 28 additions and 1 deletions

View file

@ -64,4 +64,15 @@ class CommitsController < ApplicationController
@commit = Commit.new(older)
end
end
def patch
@commit = project.commit(params[:id])
send_data(
@commit.to_patch,
:type => "text/plain",
:disposition => 'attachment',
:filename => (@commit.id.to_s + ".patch")
)
end
end