Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2019-02-06 12:54:53 +0300
committerJohn Cai <jcai@gitlab.com>2019-02-11 21:44:06 +0300
commitb502d90a9f0521247e8c42f1ed586f6f4a52507a (patch)
treed6808a5da1a71e6ceb6f6bf29d6b5b03a8248c7b /app/controllers/projects/branches_controller.rb
parent1f2f38f59a719f7dae110835b8beb3d94fdcd94d (diff)
Adapt that diverging commits could be just one bar
refactors the ui for diverging commits so that it's only a single bar instead of two separate bars
Diffstat (limited to 'app/controllers/projects/branches_controller.rb')
-rw-r--r--app/controllers/projects/branches_controller.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/controllers/projects/branches_controller.rb b/app/controllers/projects/branches_controller.rb
index a6bfb913900..32b7f3207ef 100644
--- a/app/controllers/projects/branches_controller.rb
+++ b/app/controllers/projects/branches_controller.rb
@@ -29,7 +29,8 @@ class Projects::BranchesController < Projects::ApplicationController
Gitlab::GitalyClient.allow_n_plus_1_calls do
@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
+ [memo, diverging_commit_counts.values_at(:behind, :ahead, :distance)]
+ .flatten.compact.max
end
end