summaryrefslogtreecommitdiff
path: root/app/controllers/refs_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/refs_controller.rb')
-rw-r--r--app/controllers/refs_controller.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/app/controllers/refs_controller.rb b/app/controllers/refs_controller.rb
index b48d5ec7027..09d9eb51b82 100644
--- a/app/controllers/refs_controller.rb
+++ b/app/controllers/refs_controller.rb
@@ -12,7 +12,7 @@ class RefsController < ProjectResourceController
respond_to do |format|
format.html do
new_path = if params[:destination] == "tree"
- project_tree_path(@project, @ref)
+ project_tree_path(@project, (@ref + "/" + params[:path]))
else
project_commits_path(@project, @ref)
end
@@ -31,7 +31,7 @@ class RefsController < ProjectResourceController
contents = @tree.contents
@logs = contents.map do |content|
file = params[:path] ? File.join(params[:path], content.name) : content.name
- last_commit = @project.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,
@@ -45,10 +45,10 @@ class RefsController < ProjectResourceController
def define_tree_vars
params[:path] = nil if params[:path].blank?
- @repo = project.repo
- @commit = project.commit(@ref)
+ @repo = project.repository
+ @commit = @repo.commit(@ref)
@commit = CommitDecorator.decorate(@commit)
- @tree = Tree.new(@commit.tree, project, @ref, params[:path])
+ @tree = Tree.new(@commit.tree, @ref, params[:path])
@tree = TreeDecorator.new(@tree)
@hex_path = Digest::SHA1.hexdigest(params[:path] || "")