git-hub 1.3.1 → 1.3.2
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/Rakefile +0 -1
- data/lib/hub/commands.rb +3 -5
- data/lib/hub/context.rb +6 -4
- data/lib/hub/version.rb +1 -1
- data/test/deps.rip +1 -0
- data/test/hub_test.rb +10 -2
- metadata +4 -3
data/Rakefile
CHANGED
data/lib/hub/commands.rb
CHANGED
@@ -191,7 +191,7 @@ module Hub
|
|
191
191
|
def cherry_pick(args)
|
192
192
|
unless args.include?('-m') or args.include?('--mainline')
|
193
193
|
case ref = args.words.last
|
194
|
-
when %r{^(https?:)//github.com/(.+?)/(.+?)/commit/([a-
|
194
|
+
when %r{^(https?:)//github.com/(.+?)/(.+?)/commit/([a-f0-9]{7,40})}
|
195
195
|
scheme, user, repo, sha = $1, $2, $3, $4
|
196
196
|
args[args.index(ref)] = sha
|
197
197
|
when /^(\w+)@([a-f1-9]{7,40})$/
|
@@ -224,9 +224,7 @@ module Hub
|
|
224
224
|
# > git remote add origin git@github.com:USER/REPO.git
|
225
225
|
def init(args)
|
226
226
|
if args.delete('-g')
|
227
|
-
|
228
|
-
|
229
|
-
url = github_url(:private => true)
|
227
|
+
url = github_url(:private => true, :repo => File.basename(Dir.pwd))
|
230
228
|
args.after "git remote add origin #{url}"
|
231
229
|
end
|
232
230
|
end
|
@@ -499,7 +497,7 @@ help
|
|
499
497
|
#
|
500
498
|
# Returns a Boolean.
|
501
499
|
def command?(name)
|
502
|
-
`type -t #{
|
500
|
+
`type -t #{name}`
|
503
501
|
$?.success?
|
504
502
|
end
|
505
503
|
|
data/lib/hub/context.rb
CHANGED
@@ -110,12 +110,14 @@ module Hub
|
|
110
110
|
'%s//github.com/%s/%s%s' % [scheme, user, repo, path]
|
111
111
|
else
|
112
112
|
if secure
|
113
|
-
'git@github.com:%s/%s.git'
|
113
|
+
url = 'git@github.com:%s/%s.git'
|
114
114
|
elsif http_clone?
|
115
|
-
'http://github.com/%s/%s.git'
|
115
|
+
url = 'http://github.com/%s/%s.git'
|
116
116
|
else
|
117
|
-
'git://github.com/%s/%s.git'
|
118
|
-
end
|
117
|
+
url = 'git://github.com/%s/%s.git'
|
118
|
+
end
|
119
|
+
|
120
|
+
url % [user, repo]
|
119
121
|
end
|
120
122
|
end
|
121
123
|
end
|
data/lib/hub/version.rb
CHANGED
data/test/deps.rip
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
webmock 1.3.0
|
data/test/hub_test.rb
CHANGED
@@ -294,12 +294,19 @@ class HubTest < Test::Unit::TestCase
|
|
294
294
|
end
|
295
295
|
|
296
296
|
def test_cherry_pick_url
|
297
|
-
url = 'http://github.com/mislav/hub/commit/a319d88
|
297
|
+
url = 'http://github.com/mislav/hub/commit/a319d88'
|
298
298
|
h = Hub("cherry-pick #{url}")
|
299
299
|
assert_equal "git fetch mislav", h.command
|
300
300
|
assert_equal "git cherry-pick a319d88", h.after
|
301
301
|
end
|
302
302
|
|
303
|
+
def test_cherry_pick_url_with_fragment
|
304
|
+
url = 'http://github.com/mislav/hub/commit/abcdef0123456789#comments'
|
305
|
+
h = Hub("cherry-pick #{url}")
|
306
|
+
assert_equal "git fetch mislav", h.command
|
307
|
+
assert_equal "git cherry-pick abcdef0123456789", h.after
|
308
|
+
end
|
309
|
+
|
303
310
|
def test_cherry_pick_url_with_remote_add
|
304
311
|
url = 'http://github.com/xoebus/hub/commit/a319d88'
|
305
312
|
h = Hub("cherry-pick #{url}")
|
@@ -347,9 +354,10 @@ class HubTest < Test::Unit::TestCase
|
|
347
354
|
end
|
348
355
|
|
349
356
|
def test_init
|
357
|
+
dirname = File.basename(Dir.pwd)
|
350
358
|
h = Hub("init -g")
|
351
359
|
assert_equal "git init", h.command
|
352
|
-
assert_equal "git remote add origin git@github.com:tpw
|
360
|
+
assert_equal "git remote add origin git@github.com:tpw/#{dirname}.git", h.after
|
353
361
|
end
|
354
362
|
|
355
363
|
def test_init_no_login
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 3
|
8
|
-
-
|
9
|
-
version: 1.3.
|
8
|
+
- 2
|
9
|
+
version: 1.3.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Chris Wanstrath
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-07-24 00:00:00 -07:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|
@@ -42,6 +42,7 @@ files:
|
|
42
42
|
- man/hub.1.html
|
43
43
|
- man/hub.1.ronn
|
44
44
|
- test/alias_test.rb
|
45
|
+
- test/deps.rip
|
45
46
|
- test/fakebin/git
|
46
47
|
- test/fakebin/open
|
47
48
|
- test/helper.rb
|