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@godfat.org>2018-01-05 19:52:06 +0300
committerRémy Coutable <remy@rymai.me>2018-01-05 19:52:06 +0300
commit33c5630b02a783a749cc0bf63474f643652cdeeb (patch)
tree0d30ab08be0f71e4317822f7a5a2dd13a5ad4fd7 /app/helpers/branches_helper.rb
parentb72af2b9c78527ea988bc6a69c62ec95645a6c48 (diff)
Use --left-right and --max-count for counting diverging commits
Diffstat (limited to 'app/helpers/branches_helper.rb')
-rw-r--r--app/helpers/branches_helper.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/helpers/branches_helper.rb b/app/helpers/branches_helper.rb
index 686437fc99a..2641a98e29e 100644
--- a/app/helpers/branches_helper.rb
+++ b/app/helpers/branches_helper.rb
@@ -23,4 +23,12 @@ module BranchesHelper
def protected_branch?(project, branch)
ProtectedBranch.protected?(project, branch.name)
end
+
+ def diverging_count_label(count)
+ if count >= Repository::MAX_DIVERGING_COUNT
+ "#{Repository::MAX_DIVERGING_COUNT - 1}+"
+ else
+ count.to_s
+ end
+ end
end