Sha256: 53e7760d603488f0b19bd6f2ea82931a83b0d0b19f5840399d116ab1c357be99

Contents?: true

Size: 485 Bytes

Versions: 4

Compression:

Stored size: 485 Bytes

Contents

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

4 entries across 4 versions & 1 rubygems

Version Path
rfix-1.1.0.pre.150 lib/rfix/branches/reference.rb
rfix-1.1.1.pre lib/rfix/branches/reference.rb
rfix-1.1.0.pre.149 lib/rfix/branches/reference.rb
rfix-1.1.0.pre.147 lib/rfix/branches/reference.rb