Sha256: f90399c66431743b7d132894d93c5b47fa0d57c2a0eed6273690f4009293b293

Contents?: true

Size: 737 Bytes

Versions: 12

Compression:

Stored size: 737 Bytes

Contents

class Rfix::Branch::Base
  def resolve(with:)
    raise Rfix::NotYetImplementedError.new("#resolved")
  end

  def to_s
    raise Rfix::NotYetImplementedError.new("#to_s")
  end

  def branch(using:)
    names(using: using).last or raise Rfix::Error.new("No named branch found for {{error:#{self}}}")
  end

  def names(using:)
    oid = resolve(with: using).oid
    locals = using.branches.each_name(:local).to_a

    using.branches.select do |branch|
      next false unless locals.include?(branch.name)
      branch.target_id == oid
    end
  end

  def revparse(using:, ref:)
    using.rev_parse(ref)
  rescue Rugged::InvalidError
    raise Rfix::Branch::UnknownBranchError.new("Could not find reference {{error:#{ref}}}")
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rfix-1.2.2.pre.174 lib/rfix/branches/base.rb
rfix-1.2.4 lib/rfix/branches/base.rb
rfix-1.2.3.pre lib/rfix/branches/base.rb
rfix-1.2.2.pre lib/rfix/branches/base.rb
rfix-1.2.2.pre.172 lib/rfix/branches/base.rb
rfix-1.2.2 lib/rfix/branches/base.rb
rfix-1.1.0.pre.150 lib/rfix/branches/base.rb
rfix-1.2.0 lib/rfix/branches/base.rb
rfix-1.1.4.pre lib/rfix/branches/base.rb
rfix-1.1.1.pre lib/rfix/branches/base.rb
rfix-1.1.0.pre.149 lib/rfix/branches/base.rb
rfix-1.1.0.pre.147 lib/rfix/branches/base.rb