diff --git a/app/helpers/repositories_helper.rb b/app/helpers/repositories_helper.rb index 688fd1505..8d1f11c57 100644 --- a/app/helpers/repositories_helper.rb +++ b/app/helpers/repositories_helper.rb @@ -42,10 +42,10 @@ module RepositoriesHelper end # 获取文件目录的最新动态 - def get_trees_last_changes(project_id, rev) + def get_trees_last_changes(project_id, rev, ent_name) g = Gitlab.client begin - tree_changes = g.rep_last_changes(project_id, :rev => rev) + tree_changes = g.rep_last_changes(project_id, :rev => rev, :path => ent_name) tree_changes rescue logger.error("faile to get tress activities!") diff --git a/app/views/repositories/_dir_list_content.html.erb b/app/views/repositories/_dir_list_content.html.erb index e82f10689..685a18fa8 100644 --- a/app/views/repositories/_dir_list_content.html.erb +++ b/app/views/repositories/_dir_list_content.html.erb @@ -3,11 +3,10 @@ depth = params[:depth].to_i %> <% ent_path = Redmine::CodesetUtil.replace_invalid_utf8(entry.path) %> <% ent_name = Redmine::CodesetUtil.replace_invalid_utf8(entry.name) %> -<% get_trees_last_changes(@project.id, @rev) %> +<% latest_changes = get_trees_last_changes(@project.gpid, @rev, ent_name) %>