diff options
author | Lin Jen-Shin (godfat) <godfat@godfat.org> | 2018-01-05 16:52:06 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-01-05 16:52:06 +0000 |
commit | 33c5630b02a783a749cc0bf63474f643652cdeeb (patch) | |
tree | 0d30ab08be0f71e4317822f7a5a2dd13a5ad4fd7 /app/helpers | |
parent | b72af2b9c78527ea988bc6a69c62ec95645a6c48 (diff) | |
download | gitlab-ce-33c5630b02a783a749cc0bf63474f643652cdeeb.tar.gz |
Use --left-right and --max-count for counting diverging commits
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/branches_helper.rb | 8 |
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 |