Commit 685681e2 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

remove Tree/Commit decorator usage from controllers

parent 2a6b4f96
...@@ -13,8 +13,6 @@ class CommitsController < ProjectResourceController ...@@ -13,8 +13,6 @@ class CommitsController < ProjectResourceController
@limit, @offset = (params[:limit] || 40), (params[:offset] || 0) @limit, @offset = (params[:limit] || 40), (params[:offset] || 0)
@commits = @repo.commits(@ref, @path, @limit, @offset) @commits = @repo.commits(@ref, @path, @limit, @offset)
@commits = Commit.decorate(@commits)
@commits = CommitDecorator.decorate_collection(@commits)
respond_to do |format| respond_to do |format|
format.html # index.html.erb format.html # index.html.erb
......
...@@ -15,8 +15,6 @@ class CompareController < ProjectResourceController ...@@ -15,8 +15,6 @@ class CompareController < ProjectResourceController
@diffs = result[:diffs] @diffs = result[:diffs]
@refs_are_same = result[:same] @refs_are_same = result[:same]
@line_notes = [] @line_notes = []
@commits = CommitDecorator.decorate_collection(@commits)
end end
def create def create
......
...@@ -94,12 +94,10 @@ class MergeRequestsController < ProjectResourceController ...@@ -94,12 +94,10 @@ class MergeRequestsController < ProjectResourceController
def branch_from def branch_from
@commit = @repository.commit(params[:ref]) @commit = @repository.commit(params[:ref])
@commit = CommitDecorator.decorate(@commit)
end end
def branch_to def branch_to
@commit = @repository.commit(params[:ref]) @commit = @repository.commit(params[:ref])
@commit = CommitDecorator.decorate(@commit)
end end
def ci_status def ci_status
...@@ -143,7 +141,6 @@ class MergeRequestsController < ProjectResourceController ...@@ -143,7 +141,6 @@ class MergeRequestsController < ProjectResourceController
# Get commits from repository # Get commits from repository
# or from cache if already merged # or from cache if already merged
@commits = @merge_request.commits @commits = @merge_request.commits
@commits = CommitDecorator.decorate_collection(@commits)
@allowed_to_merge = allowed_to_merge? @allowed_to_merge = allowed_to_merge?
@show_merge_controls = @merge_request.opened? && @commits.any? && @allowed_to_merge @show_merge_controls = @merge_request.opened? && @commits.any? && @allowed_to_merge
......
...@@ -34,7 +34,6 @@ class RefsController < ProjectResourceController ...@@ -34,7 +34,6 @@ class RefsController < ProjectResourceController
@logs = contents.map do |content| @logs = contents.map do |content|
file = params[:path] ? File.join(params[:path], content.name) : content.name file = params[:path] ? File.join(params[:path], content.name) : content.name
last_commit = @repo.commits(@commit.id, file, 1).last last_commit = @repo.commits(@commit.id, file, 1).last
last_commit = CommitDecorator.decorate(last_commit)
{ {
file_name: content.name, file_name: content.name,
commit: last_commit commit: last_commit
...@@ -49,9 +48,7 @@ class RefsController < ProjectResourceController ...@@ -49,9 +48,7 @@ class RefsController < ProjectResourceController
@repo = project.repository @repo = project.repository
@commit = @repo.commit(@ref) @commit = @repo.commit(@ref)
@commit = CommitDecorator.decorate(@commit)
@tree = Tree.new(@commit.tree, @ref, params[:path]) @tree = Tree.new(@commit.tree, @ref, params[:path])
@tree = TreeDecorator.new(@tree)
@hex_path = Digest::SHA1.hexdigest(params[:path] || "") @hex_path = Digest::SHA1.hexdigest(params[:path] || "")
if params[:path] if params[:path]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment