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

base_single_checker.rb « checks « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 435f4ccf5baf9b9c36eac12098cdc5d08cd484b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# frozen_string_literal: true

module Gitlab
  module Checks
    class BaseSingleChecker < BaseChecker
      attr_reader :change_access

      delegate(*SingleChangeAccess::ATTRIBUTES, to: :change_access)

      def initialize(change_access)
        @change_access = change_access
      end

      private

      def creation?
        Gitlab::Git.blank_ref?(oldrev)
      end

      def deletion?
        Gitlab::Git.blank_ref?(newrev)
      end

      def update?
        !creation? && !deletion?
      end

      def tag_exists?
        project.repository.tag_exists?(tag_name)
      end
    end
  end
end