Sha256: 9f03a0721e7c62aeefaf391b20e70412fcf9f1727025625b72b6dafe3c9f3c06

Contents?: true

Size: 708 Bytes

Versions: 23

Compression:

Stored size: 708 Bytes

Contents

# frozen_string_literal: true

require 'avm/result'

module Avm
  module Git
    module Issue
      class Complete
        module LocalTag
          def assert_tag
            if tag_hash
              return if tag_hash == branch_hash

              delete_tag
            end
            create_tag
          end

          def delete_tag
            info 'Removendo tag...'
            git(['tag', '-d', branch_name])
          end

          def tag
            "refs/tags/#{branch_name}"
          end

          def tag_hash
            @git.rev_parse(tag)
          end

          def create_tag
            git(['tag', branch_name, branch_hash])
          end
        end
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 3 rubygems

Version Path
avm-tools-0.113.5 sub/avm-git/lib/avm/git/issue/complete/local_tag.rb
avm-tools-0.113.4 sub/avm-git/lib/avm/git/issue/complete/local_tag.rb
avm-tools-0.113.3 sub/avm-git/lib/avm/git/issue/complete/local_tag.rb
avm-tools-0.113.2 sub/avm-git/lib/avm/git/issue/complete/local_tag.rb
avm-git-0.3.0 lib/avm/git/issue/complete/local_tag.rb
avm-git-0.2.0 lib/avm/git/issue/complete/local_tag.rb
avm-tools-0.110.0 vendor/avm-git/lib/avm/git/issue/complete/local_tag.rb
avm-tools-0.109.1 vendor/avm-git/lib/avm/git/issue/complete/local_tag.rb
avm-git-0.1.0 lib/avm/git/issue/complete/local_tag.rb
avm-tools-0.109.0 vendor/avm-git/lib/avm/git/issue/complete/local_tag.rb
avm-0.5.0 lib/avm/git/issue/complete/local_tag.rb
avm-tools-0.108.0 vendor/avm/lib/avm/git/issue/complete/local_tag.rb
avm-0.4.0 lib/avm/git/issue/complete/local_tag.rb
avm-tools-0.107.0 vendor/avm/lib/avm/git/issue/complete/local_tag.rb
avm-tools-0.106.0 vendor/avm/lib/avm/git/issue/complete/local_tag.rb
avm-0.3.2 lib/avm/git/issue/complete/local_tag.rb
avm-0.3.1 lib/avm/git/issue/complete/local_tag.rb
avm-tools-0.105.0 vendor/avm/lib/avm/git/issue/complete/local_tag.rb
avm-0.3.0 lib/avm/git/issue/complete/local_tag.rb
avm-tools-0.104.0 vendor/avm/lib/avm/git/issue/complete/local_tag.rb