git-hub 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/HISTORY.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 1.0.2 (2010-03-07)
2
+
3
+ * Bugfix: `hub remote -f name` (for real this time)
4
+ * Bugfix: zsh quoting [thommay]
5
+
1
6
  ## 1.0.1 (2010-03-05)
2
7
 
3
8
  * Bugfix: `hub remote -f name`
data/lib/hub/commands.rb CHANGED
@@ -119,7 +119,9 @@ module Hub
119
119
 
120
120
  if args.words[-2] == args.words[1]
121
121
  # rtomayko/tilt => rtomayko
122
- args[-1] = user
122
+ # Make sure you dance around flags.
123
+ idx = args.index( args.words[-1] )
124
+ args[idx] = user
123
125
  else
124
126
  # They're specifying the remote name manually (e.g.
125
127
  # git remote add blah rtomayko/tilt), so just drop the last
@@ -129,7 +131,7 @@ module Hub
129
131
 
130
132
  args << url % [ user, repo ]
131
133
  elsif args.last !~ /:|\//
132
- if args[2] == 'origin' && args[3].nil?
134
+ if args.words[2] == 'origin' && args.words[3].nil?
133
135
  # Origin special case.
134
136
  user = github_user
135
137
  else
@@ -137,7 +139,7 @@ module Hub
137
139
  user = args.last
138
140
  end
139
141
 
140
- if args[-2] != args[1]
142
+ if args.words[-2] != args.words[1]
141
143
  # They're specifying the remote name manually (e.g.
142
144
  # git remote add blah rtomayko), so just drop the last
143
145
  # argument.
@@ -238,7 +240,7 @@ module Hub
238
240
  shells = {
239
241
  'sh' => 'alias git=hub',
240
242
  'bash' => 'alias git=hub',
241
- 'zsh' => 'function git(){hub $@}',
243
+ 'zsh' => 'function git(){hub "$@"}',
242
244
  'csh' => 'alias git hub',
243
245
  'fish' => 'alias git hub'
244
246
  }
data/lib/hub/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Hub
2
- Version = '1.0.1'
2
+ Version = '1.0.2'
3
3
  end
data/test/alias_test.rb CHANGED
@@ -24,7 +24,7 @@ class AliasTest < Test::Unit::TestCase
24
24
  end
25
25
 
26
26
  def test_alias_zsh
27
- assert_alias_command "zsh", "function git(){hub $@}"
27
+ assert_alias_command "zsh", 'function git(){hub "$@"}'
28
28
  end
29
29
 
30
30
  def test_alias_csh
data/test/helper.rb CHANGED
@@ -3,6 +3,9 @@ $LOAD_PATH.unshift File.dirname(__FILE__) + '/../lib'
3
3
  require 'hub'
4
4
  require 'hub/standalone'
5
5
 
6
+ # We're looking for `open` in the tests.
7
+ ENV['BROWSER'] = 'open'
8
+
6
9
  class Test::Unit::TestCase
7
10
  # Shortcut for creating a `Hub` instance. Pass it what you would
8
11
  # normally pass `hub` on the command line, e.g.
data/test/hub_test.rb CHANGED
@@ -117,6 +117,12 @@ class HubTest < Test::Unit::TestCase
117
117
  assert_command input, command
118
118
  end
119
119
 
120
+ def test_public_remote_f
121
+ input = "remote add -f rtomayko"
122
+ command = "git remote add -f rtomayko git://github.com/rtomayko/hub.git"
123
+ assert_command input, command
124
+ end
125
+
120
126
  def test_named_public_remote
121
127
  input = "remote add origin rtomayko"
122
128
  command = "git remote add origin git://github.com/rtomayko/hub.git"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-hub
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Wanstrath
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-03-05 00:00:00 -08:00
12
+ date: 2010-03-07 00:00:00 -08:00
13
13
  default_executable: hub
14
14
  dependencies: []
15
15