13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/gitx/cli/start_command.rb', line 13
def start(branch_name = nil)
until valid_new_branch_name?(branch_name)
branch_name = ask("What would you like to name your branch? (ex: #{EXAMPLE_BRANCH_NAMES.sample})")
end
checkout_branch config.base_branch
run_git_cmd 'pull'
repo.create_branch branch_name, config.base_branch
checkout_branch branch_name
run_git_cmd('commit', '--allow-empty', '--message', "Starting work on #{branch_name} (Issue ##{options[:issue]})") if options[:issue]
end
|