class Branchtree::Commands::Parent

Public Instance Methods

execute() click to toggle source
Calls superclass method Branchtree::Commands::Common#execute
# File lib/branchtree/commands/parent.rb, line 11
def execute
  super

  situation = load_situation
  tree = load_tree
  current_branch = tree.find_branch(situation.current_branch_name)
  unless current_branch
    $stderr.puts "The current branch #{situation.current_branch_name} is not within the tree."
    exit 1
  end

  puts current_branch.parent_branch_name
end