Method: CapitaGit::CLI#update

Defined in:
lib/capita_git/cli.rb

#update(feature_branch = nil) ⇒ Object



134
135
136
137
138
139
140
141
# File 'lib/capita_git/cli.rb', line 134

def update(feature_branch=nil)
  repo = CapitaGit::Repository.open(Dir.pwd)
  feature_branch = feature_branch.nil? ? repo.current_branch : feature_branch
  raise "Source branch '#{feature_branch}' is not a feature branch, can't update!" unless repo.is_local_feature_branch?(feature_branch)

  log :confirm, "--> Updating feature branch '#{feature_branch}' from '#{repo.source_branch(feature_branch)}'"
  repo.rebase_local_branch(feature_branch)
end