提交 d270faee 编写于 作者: C Chris Wanstrath

bugfix: git init -g

上级 9307af31
......@@ -3,5 +3,6 @@
# hub(1)
# alias git=hub
$LOAD_PATH.unshift File.dirname(File.readlink(__FILE__)) + '/../lib'
require 'hub'
Hub::Runner.execute(*ARGV)
......@@ -224,9 +224,7 @@ module Hub
# > git remote add origin git@github.com:USER/REPO.git
def init(args)
if args.delete('-g')
# Can't do anything if we don't have a USER set.
url = github_url(:private => true)
url = github_url(:private => true, :repo => File.basename(Dir.pwd))
args.after "git remote add origin #{url}"
end
end
......
......@@ -110,12 +110,14 @@ module Hub
'%s//github.com/%s/%s%s' % [scheme, user, repo, path]
else
if secure
'git@github.com:%s/%s.git'
url = 'git@github.com:%s/%s.git'
elsif http_clone?
'http://github.com/%s/%s.git'
url = 'http://github.com/%s/%s.git'
else
'git://github.com/%s/%s.git'
end % [user, repo]
url = 'git://github.com/%s/%s.git'
end
url % [user, repo]
end
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册