diff options
author | Douwe Maan <douwe@gitlab.com> | 2016-01-06 13:06:25 +0100 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2016-01-06 13:06:25 +0100 |
commit | 639d428046938b5976f87726746d862441ee7036 (patch) | |
tree | d5db554d7efec312ccc6b7994f7dfb5d9ed23bf4 /app/controllers/projects/branches_controller.rb | |
parent | 384445eca6249363c0da6d8b96e7ee030dc6fab3 (diff) | |
parent | 95b1adb3394851132ea7ecb3104e9a857bdad82f (diff) | |
download | gitlab-ce-more-opengraph.tar.gz |
Merge branch 'master' into more-opengraphmore-opengraph
Diffstat (limited to 'app/controllers/projects/branches_controller.rb')
-rw-r--r-- | app/controllers/projects/branches_controller.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/controllers/projects/branches_controller.rb b/app/controllers/projects/branches_controller.rb index 3c2849a7601..4db3b3bf23d 100644 --- a/app/controllers/projects/branches_controller.rb +++ b/app/controllers/projects/branches_controller.rb @@ -9,6 +9,11 @@ class Projects::BranchesController < Projects::ApplicationController @sort = params[:sort] || 'name' @branches = @repository.branches_sorted_by(@sort) @branches = Kaminari.paginate_array(@branches).page(params[:page]).per(PER_PAGE) + + @max_commits = @branches.reduce(0) do |memo, branch| + diverging_commit_counts = repository.diverging_commit_counts(branch) + [memo, diverging_commit_counts[:behind], diverging_commit_counts[:ahead]].max + end end def recent |