Sha256: de7cbd63e5cba34996dab47a0579cbec96c76b2a5993e7ad1c8118c207ef5966
Contents?: true
Size: 832 Bytes
Versions: 1
Compression:
Stored size: 832 Bytes
Contents
require 'straight_line/common/command' module GitCommands # Push a branch to remote class Push < Command def initialize(branch, remote_exists = true, opts = {}) super('git') arg 'checkout' arg branch if remote_exists.is_a? Hash opts = remote_exists remote_exists = true end sub_command push_command(branch, remote_exists, opts) end def push_command(branch, remote_exists, opts) push_command = Command.new('git') .arg('push') if opts[:delete] push_command .arg('origin') .arg('--delete') .arg(branch) elsif !remote_exists push_command .arg('--set-upstream') .arg('origin') .arg(branch) end push_command end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
straight_line-0.1.1.0 | lib/straight_line/common/git_commands/push.rb |