Merge pull request #1438 from SaitoWu/bugfix/1434
tree view need use ascii-8bit, file name need be utf8.
This commit is contained in:
commit
4903910390
|
@ -18,6 +18,7 @@ module TreeHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def tree_full_path(content)
|
def tree_full_path(content)
|
||||||
|
content.name.force_encoding('utf-8')
|
||||||
if params[:path]
|
if params[:path]
|
||||||
File.join(params[:path], content.name)
|
File.join(params[:path], content.name)
|
||||||
else
|
else
|
||||||
|
|
|
@ -16,7 +16,7 @@ class Tree
|
||||||
def initialize(raw_tree, project, ref = nil, path = nil)
|
def initialize(raw_tree, project, ref = nil, path = nil)
|
||||||
@project, @ref, @path = project, ref, path,
|
@project, @ref, @path = project, ref, path,
|
||||||
@tree = if path
|
@tree = if path
|
||||||
raw_tree / path
|
raw_tree / path.dup.force_encoding('ascii-8bit')
|
||||||
else
|
else
|
||||||
raw_tree
|
raw_tree
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
.file_title
|
.file_title
|
||||||
%i.icon-file
|
%i.icon-file
|
||||||
%span.file_name
|
%span.file_name
|
||||||
= name
|
= name.force_encoding('utf-8')
|
||||||
%small #{file.mode}
|
%small #{file.mode}
|
||||||
%span.options
|
%span.options
|
||||||
= link_to "raw", blob_project_ref_path(@project, @ref, path: params[:path]), class: "btn very_small", target: "_blank"
|
= link_to "raw", blob_project_ref_path(@project, @ref, path: params[:path]), class: "btn very_small", target: "_blank"
|
||||||
|
|
Loading…
Reference in a new issue