Skip to content

Commit

Permalink
Fix hub remote -f (which rocks, sorry I broke it!)
Browse files Browse the repository at this point in the history
  • Loading branch information
defunkt committed Mar 6, 2010
1 parent b0a6225 commit 0751340
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/hub/commands.rb
Expand Up @@ -117,7 +117,7 @@ def remote(args)
# user/repo
user, repo = $1, $2

if args[-2] == args[1]
if args.words[-2] == args.words[1]
# rtomayko/tilt => rtomayko
args[-1] = user
else
Expand Down
12 changes: 12 additions & 0 deletions test/hub_test.rb
Expand Up @@ -123,6 +123,12 @@ def test_named_public_remote
assert_command input, command
end

def test_named_public_remote_f
input = "remote add -f origin rtomayko"
command = "git remote add -f origin git://github.com/rtomayko/hub.git"
assert_command input, command
end

def test_private_remote_with_repo
input = "remote add -p rtomayko/tilt"
command = "git remote add rtomayko git@github.com:rtomayko/tilt.git"
Expand All @@ -135,6 +141,12 @@ def test_public_remote_with_repo
assert_command input, command
end

def test_public_remote_f_with_repo
input = "remote add -f rtomayko/tilt"
command = "git remote add -f rtomayko git://github.com/rtomayko/tilt.git"
assert_command input, command
end

def test_named_private_remote_with_repo
input = "remote add -p origin rtomayko/tilt"
command = "git remote add origin git@github.com:rtomayko/tilt.git"
Expand Down

0 comments on commit 0751340

Please sign in to comment.