diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-13 21:12:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-13 21:12:21 +0300 |
commit | 05ade12880fb1316b086583fa98b4d2f3f26a143 (patch) | |
tree | d1f28732a0502079d4112b9ebd6456232fd3acdf /app/models/repository.rb | |
parent | 4597f7fe473d9fa622510f8967620006d4bda64e (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/repository.rb')
-rw-r--r-- | app/models/repository.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb index 63fbb86544c..5aa9267b00e 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -194,6 +194,18 @@ class Repository CommitCollection.new(container, commits, ref) end + def list_commits_by(query, ref, author: nil, before: nil, after: nil, limit: 1000) + return [] unless exists? + return [] unless has_visible_content? + return [] unless query.present? && ref.present? + + commits = raw_repository.list_commits_by( + query, ref, author: author, before: before, after: after, limit: limit).map do |c| + commit(c) + end + CommitCollection.new(container, commits, ref) + end + def find_branch(name) raw_repository.find_branch(name) end |