提交 e2be7f19 编写于 作者: P Paul Gierz

remote name can be specified in the create command

上级 08004b92
......@@ -128,7 +128,13 @@ func create(command *Command, args *Args) {
localRepo, err := github.LocalRepo()
utils.Check(err)
originName := "origin"
var originName string
if flagOriginRemoteName := args.Flag.Value("--remote-name"); flagOriginRemoteName != "" {
originName = flagOriginRemoteName
} else {
originName = "origin"
}
if originRemote, err := localRepo.RemoteByName(originName); err == nil {
originProject, err := originRemote.Project()
if err != nil || !originProject.SameAs(project) {
......
......@@ -27,6 +27,17 @@ Feature: hub create
"""
When I successfully run `hub create -p`
Then the url for "origin" should be "git@github.com:mislav/dotfiles.git"
Scenario: Create repo with new remote name specified
Given the GitHub API server:
"""
post('/user/repos') {
assert :private => false
status 201
json :full_name => 'mislav/dotfiles'
}
"""
When I sucessfully run `hub create --remote-name=work`
Then the url for "work" should be "git@github.com:mislav/dotfiles.git"
Scenario: HTTPS is preferred
Given the GitHub API server:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册