diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 08ffca920..e2a3e2d2a 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -382,7 +382,8 @@ update if request.xhr? @entries ? render(:partial => 'dir_list_content') : render(:nothing => true) else - @changesets_latest_coimmit = @g.commits(@project.gpid, :ref_name => @rev)[0] + @changesets_latest_coimmit = @g.commit(@project.gpid, @entries.first.try(:lastrev)) + # @changesets_latest_coimmit = @g.commits(@project.gpid, :ref_name => @rev)[0] # 总的提交数 @changesets_all_count = @g.user_static(@project.gpid, :rev => @rev).count diff --git a/app/models/repository.rb b/app/models/repository.rb index 305c82f97..c9346e15b 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -422,8 +422,8 @@ class Repository < ActiveRecord::Base def load_entries_changesets(entries) if entries entries.each do |entry| - if entry.lastrev && entry.lastrev.identifier - entry.changeset = find_changeset_by_name(entry.lastrev.identifier) + if entry.lastrev + entry.changeset = entry.lastrev end end end diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb index a0ae74d73..8b47190e5 100644 --- a/app/views/repositories/show.html.erb +++ b/app/views/repositories/show.html.erb @@ -49,7 +49,7 @@