diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-17 18:08:29 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-17 18:08:29 +0300 |
commit | 6c26db46b89172c15ae7b27d938db643721d59cb (patch) | |
tree | ac2f4401213bba4220e205798396f3442a21f4cd /app/services/repositories | |
parent | 6b97ea1f8008a7ddb22b1faa03496cf46c546c05 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/repositories')
-rw-r--r-- | app/services/repositories/changelog_service.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/services/repositories/changelog_service.rb b/app/services/repositories/changelog_service.rb index 4cfbf2f1fb0..7a78b323453 100644 --- a/app/services/repositories/changelog_service.rb +++ b/app/services/repositories/changelog_service.rb @@ -139,6 +139,10 @@ module Repositories def verify_commit_range!(from, to) return unless Feature.enabled?(:changelog_commits_limitation, @project) + commits = @project.repository.commits_by(oids: [from, to]) + + raise Gitlab::Changelog::Error, "Invalid or not found commit value in the given range" unless commits.count == 2 + _, commits_count = @project.repository.diverging_commit_count(from, to) if commits_count > COMMITS_LIMIT |