#173: redirect to #tree_path when blob is tree

This commit is contained in:
Vokhmin Alexey V 2013-06-10 20:44:57 +04:00
parent d01e8fa954
commit 9f80f662a5
1 changed files with 1 additions and 0 deletions

View File

@ -33,6 +33,7 @@ class Projects::Git::BlobsController < Projects::Git::BaseController
def set_blob def set_blob
@blob = @tree / @path or raise Grit::NoSuchPathError @blob = @tree / @path or raise Grit::NoSuchPathError
redirect_to tree_path(@project, :treeish => @treeish, :path => @path) if @blob.is_a? Grit::Tree
@commit = @project.repo.log(@treeish, @path, :max_count => 1).first @commit = @project.repo.log(@treeish, @path, :max_count => 1).first
end end
end end