lib/gitlab_git/repository.rb in gitlab_git-5.9.0 vs lib/gitlab_git/repository.rb in gitlab_git-6.0.0

- old
+ new

@@ -347,8 +347,16 @@ # } # def submodules(ref) Grit::Submodule.config(grit, ref) end + + # Return total commits count accessible from passed ref + def commit_count(ref) + walker = Rugged::Walker.new(rugged) + walker.sorting(Rugged::SORT_TOPO | Rugged::SORT_REVERSE) + walker.push(ref) + walker.count + end end end end