tsantos-gitadm 1.0.4 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/gitadm +8 -4
  2. metadata +2 -2
data/gitadm CHANGED
@@ -128,6 +128,7 @@ elsif :checkout == command
128
128
  =end
129
129
  elsif :create_remote_branch == command
130
130
  options.local = :master
131
+ options.remote = :origin
131
132
 
132
133
  opts = OptionParser.new do |opts|
133
134
  opts.banner = <<EOS
@@ -144,12 +145,15 @@ with tracking.
144
145
  gitadm create-remote-branch -b dabranch -c
145
146
 
146
147
  EOS
147
- opts.on('-l', '--local-branch NAME', 'The local branch to base it from. Defaults to master.') do |name|
148
+ opts.on('-l', '--local-branch NAME', 'The local branch to base it from. Defaults to "master".') do |name|
148
149
  options.local = name.to_sym
149
150
  end
150
151
  opts.on('-b', '--branch-name NAME', 'The branch name to create') do |name|
151
152
  options.branch_name = name
152
153
  end
154
+ opts.on('-r', '--remote NAME', 'The remote to use. Defaults to "origin".') do |name|
155
+ options.remote = name
156
+ end
153
157
  opts.on('-t', '--track', "Setup tracking. (doesn't apply if you used master)") do
154
158
  options.tracking = true
155
159
  end
@@ -161,11 +165,11 @@ EOS
161
165
  if !defined? ARGS || !options.branch_name then puts opts; exit(1); end
162
166
  opts.parse! ARGS
163
167
 
164
- `git push origin #{options.local}:refs/heads/#{options.branch_name}`
168
+ `git push #{options.remote} #{options.local}:refs/heads/#{options.branch_name}`
165
169
  if options.checkout && options.local == :master
166
- `git checkout --track -b #{options.branch_name} origin/#{options.branch_name}`
170
+ `git checkout --track -b #{options.branch_name} #{options.remote}/#{options.branch_name}`
167
171
  elsif options.tracking && options.local != :master
168
- `git config branch.#{options.local}.remote origin`
172
+ `git config branch.#{options.local}.remote #{options.remote}`
169
173
  `git config branch.#{options.local}.merge refs/heads/#{options.branch_name}`
170
174
  end
171
175
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tsantos-gitadm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Santos
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: .
10
10
  cert_chain: []
11
11
 
12
- date: 2009-08-04 00:00:00 -07:00
12
+ date: 2009-08-20 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15