rosa-build/app/controllers/projects/git/commits_controller.rb

20 lines
644 B
Ruby
Raw Normal View History

2012-01-30 20:39:34 +00:00
# -*- encoding : utf-8 -*-
class Projects::Git::CommitsController < Projects::Git::BaseController
def index
2011-04-04 14:49:08 +01:00
if @path.present?
@commits = @project.repo.log(@treeish, @path)
2011-04-04 14:49:08 +01:00
else
@commits, @page, @last_page = @project.paginate_commits(@treeish, :page => params[:page])
2011-04-04 14:49:08 +01:00
end
end
def show
@commit = @project.repo.commit(params[:id])
respond_to do |format|
format.html
format.diff { render :text => (@commit.diffs.map(&:diff).join("\n") rescue ''), :content_type => "text/plain" }
format.patch { render :text => (@commit.to_patch rescue ''), :content_type => "text/plain" }
end
end
2012-01-11 18:15:35 +00:00
end