BigW Consortium Gitlab

Commit 5eeea4b7 by Jacob Vosmaer

Limit the number of commits shown in MRs

This prevents timeouts when creating a MR with 1000s of commits.
parent 97093a52
- unless defined?(project)
- project = @project
- if @commits.size > MergeRequestDiff::COMMITS_SAFE_SIZE
- commits = @commits.first(MergeRequestDiff::COMMITS_SAFE_SIZE)
- overflow = true
- else
- commits = @commits
- overflow = false
- @commits.group_by { |c| c.committed_date.to_date }.sort.reverse.each do |day, commits|
- commits.group_by { |c| c.committed_date.to_date }.sort.reverse.each do |day, commits|
.row.commits-row
.col-md-2.hidden-xs.hidden-sm
%h5.commits-row-date
......@@ -13,3 +19,7 @@
%ul.bordered-list
= render commits, project: project
%hr.lists-separator
- if overflow
.alert.alert-warning
Not shown: #{@commits.size - MergeRequestDiff::COMMITS_SAFE_SIZE} more commits
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment