Sha256: ca74c3515a42f62b7c5f529a5f8f25a02aac812454a359d22324b223ab502177

Contents?: true

Size: 510 Bytes

Versions: 9

Compression:

Stored size: 510 Bytes

Contents

require_relative "base"

module Rfix
  class Branch::Reference < Branch::Base
    attr_reader :reference

    def initialize(reference)
      @reference = reference
    end

    def resolve(with:)
      Branch::Name.new(reference).resolve(with: with)
    rescue Branch::UnknownBranchError
      revparse(using: with, ref: reference)
    rescue Rugged::InvalidError
      raise Branch::UnknownBranchError.new("Branch with reference {{error:#{reference}}} not found")
    end

    alias to_s reference
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rfix-1.2.2.pre.174 lib/rfix/branches/reference.rb
rfix-1.2.5 lib/rfix/branches/reference.rb
rfix-1.2.4 lib/rfix/branches/reference.rb
rfix-1.2.3.pre lib/rfix/branches/reference.rb
rfix-1.2.2.pre lib/rfix/branches/reference.rb
rfix-1.2.2.pre.172 lib/rfix/branches/reference.rb
rfix-1.2.2 lib/rfix/branches/reference.rb
rfix-1.2.0 lib/rfix/branches/reference.rb
rfix-1.1.4.pre lib/rfix/branches/reference.rb