Commit 49039103 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge pull request #1438 from SaitoWu/bugfix/1434

tree view need use ascii-8bit, file name need be utf8.
parents 9fb595eb 96d4f22e
......@@ -18,7 +18,8 @@ module TreeHelper
end
def tree_full_path(content)
if params[:path]
content.name.force_encoding('utf-8')
if params[:path]
File.join(params[:path], content.name)
else
content.name
......
......@@ -16,7 +16,7 @@ class Tree
def initialize(raw_tree, project, ref = nil, path = nil)
@project, @ref, @path = project, ref, path,
@tree = if path
raw_tree / path
raw_tree / path.dup.force_encoding('ascii-8bit')
else
raw_tree
end
......
......@@ -2,7 +2,7 @@
.file_title
%i.icon-file
%span.file_name
= name
= name.force_encoding('utf-8')
%small #{file.mode}
%span.options
= link_to "raw", blob_project_ref_path(@project, @ref, path: params[:path]), class: "btn very_small", target: "_blank"
......
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