Class: Rfix::Branch::Name

Inherits:
Base
  • Object
show all
Defined in:
lib/rfix/branch/name.rb

Direct Known Subclasses

Main

Instance Method Summary collapse

Instance Method Details

#resolveObject



8
9
10
11
12
13
14
15
16
# File 'lib/rfix/branch/name.rb', line 8

def resolve
  unless (branch = repository.branches[name])
    raise UnknownBranchError, branch
  end

  repository.lookup(repository.merge_base(branch.target_id, repository.head.target_id))
rescue Rugged::ReferenceError
  raise UnknownBranchError, name
end