Sha256: 55e02ca49e48775a104f16917f504e70e4970582e25ce1f3afc9877bc4c34e75

Contents?: true

Size: 477 Bytes

Versions: 14

Compression:

Stored size: 477 Bytes

Contents

require 'forwardable'

module Overcommit::Hook::PostCheckout
  # Functionality common to all post-checkout hooks.
  class Base < Overcommit::Hook::Base
    extend Forwardable

    def_delegators :@context,
                   :previous_head, :new_head, :branch_checkout?, :file_checkout?

    def skip_file_checkout?
      @config['skip_file_checkout'] != false
    end

    def enabled?
      return false if file_checkout? && skip_file_checkout?
      super
    end
  end
end

Version data entries

14 entries across 12 versions & 2 rubygems

Version Path
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/overcommit-0.46.0/lib/overcommit/hook/post_checkout/base.rb
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/overcommit-0.46.0/lib/overcommit/hook/post_checkout/base.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/overcommit-0.46.0/lib/overcommit/hook/post_checkout/base.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/overcommit-0.46.0/lib/overcommit/hook/post_checkout/base.rb
overcommit-0.46.0 lib/overcommit/hook/post_checkout/base.rb
overcommit-0.45.0 lib/overcommit/hook/post_checkout/base.rb
overcommit-0.44.0 lib/overcommit/hook/post_checkout/base.rb
overcommit-0.43.0 lib/overcommit/hook/post_checkout/base.rb
overcommit-0.42.0 lib/overcommit/hook/post_checkout/base.rb
overcommit-0.41.0 lib/overcommit/hook/post_checkout/base.rb
overcommit-0.40.0 lib/overcommit/hook/post_checkout/base.rb
overcommit-0.39.1 lib/overcommit/hook/post_checkout/base.rb
overcommit-0.39.0 lib/overcommit/hook/post_checkout/base.rb
overcommit-0.38.0 lib/overcommit/hook/post_checkout/base.rb