зеркало из https://github.com/mislav/hub.git
remote name can be specified in the create command
This commit is contained in:
Родитель
08004b9218
Коммит
e2be7f1960
|
@ -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:
|
||||
|
|
Загрузка…
Ссылка в новой задаче