Welcome to mirror list, hosted at ThFree Co, Russian Federation.

matching_merge_request.rb « checks « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 849848515da66a210ff00a0f2c9de3ce6f306f7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
module Gitlab
  module Checks
    class MatchingMergeRequest
      def initialize(newrev, branch_name, project)
        @newrev = newrev
        @branch_name = branch_name
        @project = project
      end

      def match?
        @project.merge_requests
          .with_state(:locked)
          .where(in_progress_merge_commit_sha: @newrev, target_branch: @branch_name)
          .exists?
      end
    end
  end
end