diff --git a/app/helpers/tree_helper.rb b/app/helpers/tree_helper.rb index c51ee84a..a5d5c742 100644 --- a/app/helpers/tree_helper.rb +++ b/app/helpers/tree_helper.rb @@ -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 diff --git a/app/models/tree.rb b/app/models/tree.rb index bc95d335..d65e50ab 100644 --- a/app/models/tree.rb +++ b/app/models/tree.rb @@ -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 diff --git a/app/views/refs/_tree_file.html.haml b/app/views/refs/_tree_file.html.haml index 765f271a..f6566ccf 100644 --- a/app/views/refs/_tree_file.html.haml +++ b/app/views/refs/_tree_file.html.haml @@ -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"