Permalink
Browse files

fix `git init -g`

Closes #113
  • Loading branch information...
1 parent 5b7bc77 commit 539b4c52dd418cf255559828c91f9a8b1de76cb5 @mislav mislav committed Dec 6, 2011
Showing with 3 additions and 1 deletion.
  1. +1 −1 lib/hub/commands.rb
  2. +2 −0 test/hub_test.rb
View
@@ -387,7 +387,7 @@ def am(args)
# > git remote add origin git@github.com:USER/REPO.git
def init(args)
if args.delete('-g')
- url = git_url(github_user, repo_name, :private => true)
+ url = git_url(github_user, File.basename(current_dir), :private => true)
args.after ['remote', 'add', 'origin', url]
end
end
View
@@ -502,6 +502,8 @@ def test_apply_gist
end
def test_init
+ stub_no_remotes
+ stub_no_git_repo
assert_commands "git init", "git remote add origin git@github.com:tpw/hub.git", "init -g"
end

0 comments on commit 539b4c5

Please sign in to comment.