git-hub 1.1.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -36,12 +36,16 @@ Install
36
36
  Assuming `~/bin/` is in your `$PATH`, you're ready to roll:
37
37
 
38
38
  $ hub version
39
- git version 1.6.4.2
40
- hub version 0.3.2
39
+ git version 1.7.0.4
40
+ hub version 1.1.0
41
41
 
42
42
  ### Homebrew
43
43
 
44
- brew install hub
44
+ $ brew install hub
45
+ $ which hub
46
+ /usr/local/bin/hub
47
+ $ hub version
48
+ ...
45
49
 
46
50
  ### RubyGems
47
51
 
@@ -49,18 +53,20 @@ Though not recommended, `hub` can also be installed as a RubyGem:
49
53
 
50
54
  $ gem install git-hub
51
55
 
52
- (Yes, the gem name is `git-hub`.)
56
+ Yes, the gem name is "git-hub".
53
57
 
54
- (It's not recommended because of the RubyGems startup time. See [this
55
- gist][speed] for information.)
58
+ (It's not recommended for casual use because of the RubyGems startup
59
+ time. See [this gist][speed] for information.)
56
60
 
57
61
  ### Standalone via RubyGems
58
62
 
59
- Yes, the gem name is still `git-hub`:
63
+ Yes, the gem name is still "git-hub":
60
64
 
61
65
  $ gem install git-hub
62
66
  $ hub hub standalone > ~/bin/hub && chmod 755 ~/bin/hub
63
- $ gem uninstall git-hub
67
+
68
+ This installs a standalone version which doesn't require RubyGems to
69
+ run.
64
70
 
65
71
  ### Source
66
72
 
@@ -74,7 +80,7 @@ You can also install from source:
74
80
  Aliasing
75
81
  --------
76
82
 
77
- hub works best when it wraps `git`. This is not dangerous - your
83
+ `hub` works best when it wraps `git`. This is not dangerous - your
78
84
  normal git commands should all work. hub merely adds some sugar.
79
85
 
80
86
  Typing `hub alias <shell>` will display alias instructions for
@@ -153,18 +159,50 @@ login" below for details.
153
159
  $ git browse
154
160
  > open http://github.com/CURRENT_REPO
155
161
 
162
+ $ git browse -- issues
163
+ > open http://github.com/CURRENT_REPO/issues
164
+
156
165
  $ git browse schacon/ticgit
157
166
  > open http://github.com/schacon/ticgit
158
167
 
159
168
  $ git browse -p schacon/ticgit
160
- > open http://github.com/schacon/ticgit
169
+ > open https://github.com/schacon/ticgit
161
170
 
162
171
  $ git browse resque
163
172
  > open http://github.com/YOUR_USER/resque
164
173
 
174
+ $ git browse resque network
175
+ > open http://github.com/YOUR_USER/resque/network
176
+
165
177
  $ git browse -p resque
166
178
  > open https://github.com:YOUR_USER/resque
167
179
 
180
+ ### git compare
181
+
182
+ $ git compare refactor
183
+ > open http://github.com/CURRENT_REPO/compare/refactor
184
+
185
+ $ git compare 1.0...1.1
186
+ > open http://github.com/CURRENT_REPO/compare/1.0...1.1
187
+
188
+ $ git compare -u fix
189
+ > (http://github.com/CURRENT_REPO/compare/fix)
190
+
191
+ $ git compare other-user patch
192
+ > open http://github.com/other-user/REPO/compare/patch
193
+
194
+ ### git submodule
195
+
196
+ $ hub submodule add wycats/bundler vendor/bundler
197
+ > git submodule add git://github.com/wycats/bundler.git vendor/bundler
198
+
199
+ $ hub submodule add -p wycats/bundler vendor/bundler
200
+ > git submodule add git@github.com:wycats/bundler.git vendor/bundler
201
+
202
+ $ hub submodule add -b ryppl ryppl/pip vendor/pip
203
+ > git submodule add -b ryppl git://github.com/ryppl/pip.git vendor/pip
204
+
205
+
168
206
  ### git help
169
207
 
170
208
  $ git help
@@ -195,13 +233,13 @@ Configuration
195
233
  -------------
196
234
 
197
235
  If you prefer `http://` clones to `git://` clones, you can set the
198
- `hub.http-clone` option using `git-config`.
236
+ `hub.http-clone` option to true using `git-config`.
199
237
 
200
238
  For example:
201
239
 
202
240
  $ git clone defunkt/repl
203
241
  < git clone >
204
- $ git config --global --add hub.http-clone yes
242
+ $ git config --global --bool hub.http-clone true
205
243
  $ git clone defunkt/repl
206
244
  < http clone >
207
245
 
@@ -234,6 +272,16 @@ Once you've made your great commits:
234
272
  4. Create an [Issue][1] with a link to your branch
235
273
  5. That's it!
236
274
 
275
+ ### Development Gems
276
+ You will need the following gems (and their dependencies) to
277
+ contribute to `hub`:
278
+
279
+ * `rake` (`gem install rake`)
280
+ * `kicker` (`gem install kicker`)
281
+ * `turn` (`gem install turn`)
282
+ * `mg` (`gem install mg`)
283
+ * `ronn` (`gem install ronn`)
284
+ * `webhelper` (`gem install webhelper`)
237
285
 
238
286
  Meta
239
287
  ----
data/Rakefile CHANGED
@@ -1,37 +1,12 @@
1
1
  require 'rake/testtask'
2
2
 
3
- task :default => :test
4
-
5
- Rake::TestTask.new do |t|
6
- t.libs << 'lib'
7
- t.ruby_opts << '-rubygems'
8
- t.pattern = 'test/**/*_test.rb'
9
- t.verbose = false
10
- end
11
-
12
- desc "Launch Kicker (like autotest)"
13
- task :kicker do
14
- puts "Kicking... (ctrl+c to cancel)"
15
- exec "kicker -e rake test lib"
16
- end
17
-
18
- desc "Build a gem"
19
- task :gem => [ :gemspec, :build ]
20
-
21
- desc "Build standalone script"
22
- task :standalone => :load_hub do
23
- require 'hub/standalone'
24
- Hub::Standalone.save('hub')
25
- end
3
+ #
4
+ # Helpers
5
+ #
26
6
 
27
- desc "Build hub manual"
28
- task "man:build" do
29
- sh "ron -br5 --organization=DEFUNKT --manual='Git Manual' man/*.ron"
30
- end
31
-
32
- desc "Show hub manual"
33
- task :man => "man:build" do
34
- exec "man man/hub.1"
7
+ def command?(command)
8
+ `type -t #{command}`
9
+ $?.success?
35
10
  end
36
11
 
37
12
  task :load_hub do
@@ -39,54 +14,77 @@ task :load_hub do
39
14
  require 'hub'
40
15
  end
41
16
 
42
- begin
43
- require 'jeweler'
44
- $LOAD_PATH.unshift 'lib'
45
- require 'hub'
46
- Jeweler::Tasks.new do |gemspec|
47
- gemspec.name = "git-hub"
48
- gemspec.summary = gemspec.description = "hub introduces git to GitHub"
49
- gemspec.homepage = "http://github.com/defunkt/hub"
50
- gemspec.version = Hub::Version
51
- gemspec.authors = ["Chris Wanstrath"]
52
- gemspec.email = "chris@ozmm.org"
53
- gemspec.executables = ["hub"]
54
- gemspec.post_install_message = <<-message
17
+ task :check_dirty do
18
+ if !`git status`.include?('nothing to commit')
19
+ abort "dirty index - not publishing!"
20
+ end
21
+ end
55
22
 
56
- ------------------------------------------------------------
57
23
 
58
- You there! Wait, I say!
59
- =======================
24
+ #
25
+ # Tests
26
+ #
60
27
 
61
- If you are a heavy user of `git` on the command
62
- line you may want to install `hub` the old
63
- fashioned way. Faster startup time, you see.
28
+ task :default => :test
64
29
 
65
- Check out the installation instructions at
66
- http://github.com/defunkt/hub#readme under the
67
- "Standalone" section.
30
+ if command? :turn
31
+ desc "Run tests"
32
+ task :test do
33
+ suffix = "-n #{ENV['TEST']}" if ENV['TEST']
34
+ sh "turn test/*.rb #{suffix}"
35
+ end
36
+ else
37
+ Rake::TestTask.new do |t|
38
+ t.libs << 'lib'
39
+ t.ruby_opts << '-rubygems'
40
+ t.pattern = 'test/**/*_test.rb'
41
+ t.verbose = false
42
+ end
43
+ end
44
+
45
+ if command? :kicker
46
+ desc "Launch Kicker (like autotest)"
47
+ task :kicker do
48
+ puts "Kicking... (ctrl+c to cancel)"
49
+ exec "kicker -e rake test lib"
50
+ end
51
+ end
68
52
 
69
- Cheers,
70
- defunkt
71
53
 
72
- ------------------------------------------------------------
54
+ #
55
+ # Ron
56
+ #
73
57
 
74
- message
58
+ if command? :ronn
59
+ desc "Show the manual"
60
+ task :man => "man:build" do
61
+ exec "man man/hub.1"
62
+ end
63
+
64
+ desc "Build the manual"
65
+ task "man:build" do
66
+ sh "ronn -br5 --organization=DEFUNKT --manual='Git Manual' man/*.ronn"
75
67
  end
76
- rescue LoadError
77
- puts "Jeweler not available."
78
- puts "Install it with: gem install jeweler"
79
68
  end
80
69
 
81
70
 
82
- Rake::TaskManager.class_eval do
83
- def remove_task(task_name)
84
- @tasks.delete(task_name.to_s)
85
- end
71
+ #
72
+ # Gems
73
+ #
74
+
75
+ desc "Build standalone script"
76
+ task :standalone => :load_hub do
77
+ require 'hub/standalone'
78
+ Hub::Standalone.save('hub')
86
79
  end
87
80
 
88
- # Remove jewelers install task
89
- Rake.application.remove_task(:install)
81
+ begin
82
+ require 'mg'
83
+ MG.new('git-hub.gemspec')
84
+ rescue LoadError
85
+ warn "mg not available."
86
+ warn "Install it with: gem install mg"
87
+ end
90
88
 
91
89
  desc "Install standalone script and man pages"
92
90
  task :install => :standalone do
@@ -99,13 +97,14 @@ task :install => :standalone do
99
97
  FileUtils.cp "man/hub.1", "#{prefix}/share/man/man1"
100
98
  end
101
99
 
102
- desc "Push a new version to Gemcutter"
103
- task :publish => [ :test, :gemspec, :build ] do
104
- system "git tag v#{Hub::Version}"
105
- system "git push origin v#{Hub::Version}"
106
- system "git push origin master"
107
- system "gem push pkg/git-hub-#{Hub::Version}.gem"
108
- system "git clean -fd"
100
+ desc "Push a new version."
101
+ task :publish => "gem:publish" do
102
+ require 'hub/version'
103
+ sh "git tag v#{Hub::Version}"
104
+ sh "git push origin v#{Hub::Version}"
105
+ sh "git push origin master"
106
+ sh "gem push pkg/git-hub-#{Hub::Version}.gem"
107
+ sh "git clean -fd"
109
108
  exec "rake pages"
110
109
  end
111
110
 
@@ -122,9 +121,3 @@ task :pages => [ "man:build", :check_dirty, :standalone ] do
122
121
  sh "git checkout master"
123
122
  puts :done
124
123
  end
125
-
126
- task :check_dirty do
127
- if !`git status`.include?('nothing to commit')
128
- abort "dirty index - not publishing!"
129
- end
130
- end
data/lib/hub/commands.rb CHANGED
@@ -1,4 +1,7 @@
1
1
  module Hub
2
+ # See context.rb
3
+ module Context; end
4
+
2
5
  # The Commands module houses the git commands that hub
3
6
  # lovingly wraps. If a method exists here, it is expected to have a
4
7
  # corresponding git command which either gets run before or after
@@ -31,25 +34,11 @@ module Hub
31
34
  instance_methods.each { |m| undef_method(m) unless m =~ /(^__|send|to\?$)/ }
32
35
  extend self
33
36
 
34
- # Templates and useful information.
35
- USER = `git config --global github.user`.chomp
36
- TOKEN = `git config --global github.token`.chomp
37
- ORIGIN = `git config remote.origin.url`.chomp
38
- HTTP_CLONE = `git config --global hub.http-clone`.chomp == 'yes'
39
- PUBLIC = (HTTP_CLONE ? 'http' : 'git') + '://github.com/%s/%s.git'
40
- PRIVATE = 'git@github.com:%s/%s.git'
41
- LGHCONF = "http://github.com/guides/local-github-config"
42
- API_REPO = 'http://github.com/api/v2/yaml/repos/show/%s/%s'
43
- API_FORK = 'http://github.com/api/v2/yaml/repos/fork/%s/%s'
44
-
45
- # Set the repo name based on the current origin or, as a fallback,
46
- # the cwd.
47
- if ORIGIN =~ %r{\bgithub\.com[:/](.+)/(.+).git$}
48
- OWNER, REPO = $1, $2
49
- else
50
- REPO = File.basename(Dir.pwd)
51
- OWNER = ''
52
- end
37
+ # Provides `github_url` and various inspection methods
38
+ extend Context
39
+
40
+ API_REPO = 'http://github.com/api/v2/yaml/repos/show/%s/%s'
41
+ API_FORK = 'http://github.com/api/v2/yaml/repos/fork/%s/%s'
53
42
 
54
43
  # $ hub clone rtomayko/tilt
55
44
  # > git clone git://github.com/rtomayko/tilt.
@@ -76,15 +65,10 @@ module Hub
76
65
  if arg =~ %r{.+?://|.+?@} || File.directory?(arg)
77
66
  # Bail out early for URLs and local paths.
78
67
  break
79
- elsif arg.scan('/').size == 1 && !arg.include?(':')
68
+ elsif arg.scan('/').size <= 1 && !arg.include?(':')
80
69
  # $ hub clone rtomayko/tilt
81
- url = ssh ? PRIVATE : PUBLIC
82
- args[args.index(arg)] = url % arg.split('/')
83
- break
84
- elsif arg !~ /:|\//
85
70
  # $ hub clone tilt
86
- url = ssh ? PRIVATE : PUBLIC
87
- args[args.index(arg)] = url % [ github_user, arg ]
71
+ args[args.index(arg)] = github_url(:repo => arg, :private => ssh)
88
72
  break
89
73
  end
90
74
  end
@@ -95,10 +79,24 @@ module Hub
95
79
  #
96
80
  # $ hub submodule add -p wycats/bundler vendor/bundler
97
81
  # > git submodule add git@github.com:wycats/bundler.git vendor/bundler
82
+ #
83
+ # $ hub submodule add -b ryppl ryppl/pip vendor/bundler
84
+ # > git submodule add -b ryppl git://github.com/ryppl/pip.git vendor/pip
98
85
  def submodule(args)
99
86
  return unless index = args.index('add')
100
87
  args.delete_at index
88
+
89
+ branch = args.index('-b') || args.index('--branch')
90
+ if branch
91
+ args.delete_at branch
92
+ branch_name = args.delete_at branch
93
+ end
94
+
101
95
  clone(args)
96
+
97
+ if branch_name
98
+ args.insert branch, '-b', branch_name
99
+ end
102
100
  args.insert index, 'add'
103
101
  end
104
102
 
@@ -111,18 +109,17 @@ module Hub
111
109
  # $ hub remote add origin
112
110
  # > git remote add origin git://github.com/YOUR_LOGIN/THIS_REPO.git
113
111
  def remote(args)
114
- return if args[1] != 'add' or args.last =~ %r{.+?://|.+?@}
112
+ return if args[1] != 'add' || args.last =~ %r{.+?://|.+?@|^[./]}
115
113
 
116
114
  ssh = args.delete('-p')
117
- url = ssh ? PRIVATE : PUBLIC
118
115
 
119
116
  # user/repo
120
117
  args.last =~ /\b(.+?)(?:\/(.+))?$/
121
- user, repo = $1, $2 || REPO
118
+ user, repo = $1, $2
122
119
 
123
120
  if args.words[2] == 'origin' && args.words[3].nil?
124
- # Origin special case.
125
- user = github_user
121
+ # Origin special case triggers default user/repo
122
+ user = repo = nil
126
123
  elsif args.words[-2] == args.words[1]
127
124
  # rtomayko/tilt => rtomayko
128
125
  # Make sure you dance around flags.
@@ -135,7 +132,7 @@ module Hub
135
132
  args.replace args[0...-1]
136
133
  end
137
134
 
138
- args << url % [ user, repo ]
135
+ args << github_url(:user => user, :repo => repo, :private => ssh)
139
136
  end
140
137
 
141
138
  # $ hub init -g
@@ -145,7 +142,7 @@ module Hub
145
142
  if args.delete('-g')
146
143
  # Can't do anything if we don't have a USER set.
147
144
 
148
- url = PRIVATE % [ github_user, REPO ]
145
+ url = github_url(:private => true)
149
146
  args.after "git remote add origin #{url}"
150
147
  end
151
148
  end
@@ -157,9 +154,9 @@ module Hub
157
154
  require 'net/http'
158
155
 
159
156
  # can't do anything without token and original owner name
160
- if github_user && github_token && !OWNER.empty?
157
+ if github_user && github_token && repo_owner
161
158
  if own_repo_exists?
162
- puts "#{github_user}/#{REPO} already exists on GitHub"
159
+ puts "#{github_user}/#{repo_name} already exists on GitHub"
163
160
  else
164
161
  fork_repo
165
162
  end
@@ -167,7 +164,7 @@ module Hub
167
164
  if args.include?('--no-remote')
168
165
  exit
169
166
  else
170
- url = PRIVATE % [ github_user, REPO ]
167
+ url = github_url(:private => true)
171
168
  args.replace %W"remote add -f #{github_user} #{url}"
172
169
  args.after { puts "new remote: #{github_user}" }
173
170
  end
@@ -196,6 +193,9 @@ module Hub
196
193
  # $ hub browse
197
194
  # > open http://github.com/CURRENT_REPO
198
195
  #
196
+ # $ hub browse -- issues
197
+ # > open http://github.com/CURRENT_REPO/issues
198
+ #
199
199
  # $ hub browse pjhyett/github-services
200
200
  # > open http://github.com/pjhyett/github-services
201
201
  #
@@ -205,31 +205,75 @@ module Hub
205
205
  # $ hub browse github-services
206
206
  # > open http://github.com/YOUR_LOGIN/github-services
207
207
  #
208
+ # $ hub browse github-services wiki
209
+ # > open http://wiki.github.com/YOUR_LOGIN/github-services
210
+ #
208
211
  # $ hub browse -p github-fi
209
212
  # > open https://github.com/YOUR_LOGIN/github-fi
210
213
  def browse(args)
211
214
  args.shift
212
- protocol = args.delete('-p') ? 'https' : 'http'
213
- dest = args.pop
215
+ browse_command(args) do
216
+ user = repo = nil
217
+ dest = args.shift
218
+ dest = nil if dest == '--'
214
219
 
215
- if dest
216
- if dest.include? '/'
220
+ if dest
217
221
  # $ hub browse pjhyett/github-services
218
- user, repo = dest.split('/')
219
- else
220
222
  # $ hub browse github-services
221
- user, repo = github_user, dest
223
+ repo = dest
224
+ elsif repo_user
225
+ # $ hub browse
226
+ user = repo_user
227
+ else
228
+ abort "Usage: hub browse [<USER>/]<REPOSITORY>"
222
229
  end
223
- elsif !OWNER.empty?
224
- # $ hub browse
225
- user, repo = OWNER, REPO
226
- else
227
- warn "Usage: hub browse [<USER>/]<REPOSITORY>"
228
- exit(1)
230
+
231
+ params = { :user => user, :repo => repo }
232
+
233
+ # $ hub browse -- wiki
234
+ case subpage = args.shift
235
+ when 'wiki'
236
+ params[:web] = 'wiki'
237
+ when 'commits'
238
+ branch = (!dest && tracked_branch) || 'master'
239
+ params[:web] = "/commits/#{branch}"
240
+ when 'tree', NilClass
241
+ branch = !dest && tracked_branch
242
+ params[:web] = "/tree/#{branch}" if branch && branch != 'master'
243
+ else
244
+ params[:web] = "/#{subpage}"
245
+ end
246
+
247
+ params
229
248
  end
249
+ end
230
250
 
231
- args.executable = ENV['BROWSER'] || 'open'
232
- args.push "#{protocol}://github.com/#{user}/#{repo}"
251
+ # $ hub compare 1.0...fix
252
+ # > open http://github.com/CURRENT_REPO/compare/1.0...fix
253
+ # $ hub compare refactor
254
+ # > open http://github.com/CURRENT_REPO/compare/refactor
255
+ # $ hub compare myfork feature
256
+ # > open http://github.com/myfork/REPO/compare/feature
257
+ # $ hub compare -p myfork topsecret
258
+ # > open https://github.com/myfork/REPO/compare/topsecret
259
+ # $ hub compare -u 1.0...2.0
260
+ # prints "http://github.com/CURRENT_REPO/compare/1.0...2.0"
261
+ def compare(args)
262
+ args.shift
263
+ browse_command(args) do
264
+ if args.empty?
265
+ branch = tracked_branch
266
+ if branch && branch != 'master'
267
+ range, user = branch, repo_user
268
+ else
269
+ abort "Usage: hub compare [USER] [<START>...]<END>"
270
+ end
271
+ else
272
+ range = args.pop
273
+ user = args.pop || repo_user
274
+ end
275
+ { :user => user, :web => "/compare/#{range}" }
276
+ end
233
277
  end
234
278
 
235
279
  # $ hub hub standalone
@@ -367,28 +411,51 @@ help
367
411
  # from the command line.
368
412
  #
369
413
 
370
- # Either returns the GitHub user as set by git-config(1) or aborts
371
- # with an error message.
372
- def github_user
373
- if USER.empty?
374
- abort "** No GitHub user set. See #{LGHCONF}"
375
- else
376
- USER
377
- end
414
+ # Checks whether a command exists on this system in the $PATH.
415
+ #
416
+ # name - The String name of the command to check for.
417
+ #
418
+ # Returns a Boolean.
419
+ def command?(name)
420
+ `type -t #{command}`
421
+ $?.success?
378
422
  end
379
423
 
380
- def github_token
381
- if TOKEN.empty?
382
- abort "** No GitHub token set. See #{LGHCONF}"
424
+ # Detects commands to launch the user's browser, checking $BROWSER
425
+ # first then falling back to a few common launchers. Aborts with
426
+ # an error if it can't find anything appropriate.
427
+ #
428
+ # Returns a launch command.
429
+ def browser_launcher
430
+ if ENV['BROWSER']
431
+ ENV['BROWSER']
432
+ elsif RUBY_PLATFORM.include?('darwin')
433
+ "open"
434
+ elsif command?("xdg-open")
435
+ "xdg-open"
436
+ elsif command?("cygstart")
437
+ "cygstart"
383
438
  else
384
- TOKEN
439
+ abort "Please set $BROWSER to a web launcher to use this command."
385
440
  end
386
441
  end
387
442
 
443
+ # Handles common functionality of browser commands like `browse`
444
+ # and `compare`. Yields a block that returns params for `github_url`.
445
+ def browse_command(args)
446
+ url_only = args.delete('-u')
447
+ secure = args.delete('-p')
448
+ params = yield
449
+
450
+ args.executable = url_only ? 'echo' : browser_launcher
451
+ args.push github_url({:web => true, :private => secure}.update(params))
452
+ end
453
+
454
+
388
455
  # Returns the terminal-formatted manpage, ready to be printed to
389
456
  # the screen.
390
457
  def hub_manpage
391
- return "** Can't find groff(1)" unless groff?
458
+ return "** Can't find groff(1)" unless command?('groff')
392
459
 
393
460
  require 'open3'
394
461
  out = nil
@@ -400,12 +467,6 @@ help
400
467
  out
401
468
  end
402
469
 
403
- # Returns true if groff is installed and in our path, false if
404
- # not.
405
- def groff?
406
- system("which groff")
407
- end
408
-
409
470
  # The groff command complete with crazy arguments we need to run
410
471
  # in order to turn our raw roff (manpage markup) into something
411
472
  # readable on the terminal.
@@ -474,7 +535,7 @@ help
474
535
  #
475
536
  # Returns a Boolean.
476
537
  def own_repo_exists?
477
- url = API_REPO % [USER, REPO]
538
+ url = API_REPO % [github_user, repo_name]
478
539
  Net::HTTPSuccess === Net::HTTP.get_response(URI(url))
479
540
  end
480
541
 
@@ -482,8 +543,8 @@ help
482
543
  #
483
544
  # Returns nothing.
484
545
  def fork_repo
485
- url = API_FORK % [OWNER, REPO]
486
- Net::HTTP.post_form(URI(url), 'login' => USER, 'token' => TOKEN)
546
+ url = API_FORK % [repo_owner, repo_name]
547
+ Net::HTTP.post_form(URI(url), 'login' => github_user, 'token' => github_token)
487
548
  end
488
549
  end
489
550
  end