diff --git a/app/helpers/repositories_helper.rb b/app/helpers/repositories_helper.rb index 72bee4843..ef637d3ee 100644 --- a/app/helpers/repositories_helper.rb +++ b/app/helpers/repositories_helper.rb @@ -47,13 +47,11 @@ module RepositoriesHelper end # 获取文件目录的最新动态 - def get_trees_last_changes(project_id, rev, ent_name) - g = Gitlab.client + def get_trees_last_changes(project_id, rev, ent_name, g) begin tree_changes = g.rep_last_changes(project_id, :rev => rev, :path => ent_name) - tree_changes - rescue - logger.error("faile to get tress activities!") + rescue Exception => e + puts e end end diff --git a/app/views/repositories/_dir_list_content.html.erb b/app/views/repositories/_dir_list_content.html.erb index 7a378dcb2..068ae0a1b 100644 --- a/app/views/repositories/_dir_list_content.html.erb +++ b/app/views/repositories/_dir_list_content.html.erb @@ -4,7 +4,7 @@ <% sub_path = entry.path[0] == "/" ? entry.path.sub("/", "") : entry.path %> <% ent_path = Redmine::CodesetUtil.replace_invalid_utf8(sub_path) %> <% ent_name = Redmine::CodesetUtil.replace_invalid_utf8(entry.name) %> - <% latest_changes = get_trees_last_changes(@project.gpid, @rev, ent_path) %> + <% latest_changes = get_trees_last_changes(@project.gpid, @rev, ent_path, @g) %>