зеркало из https://github.com/mislav/hub.git
Prevent setting a public upstream when creating a private repo.
Fixes #1854
This commit is contained in:
Родитель
4f0f0cf25c
Коммит
7639c2608a
|
@ -110,7 +110,18 @@ func create(command *Command, args *Args) {
|
|||
gh := github.NewClient(project.Host)
|
||||
|
||||
if gh.IsRepositoryExist(project) {
|
||||
ui.Errorln("Existing repository detected. Updating git remote")
|
||||
|
||||
repo, err := gh.Repository(project)
|
||||
if err != nil {
|
||||
utils.Check(err)
|
||||
}
|
||||
|
||||
if !repo.Private && flagCreatePrivate {
|
||||
err = fmt.Errorf("Existing public repository detected. git remote not updated")
|
||||
utils.Check(err)
|
||||
} else {
|
||||
ui.Errorln("Existing repository detected. Updating git remote")
|
||||
}
|
||||
} else {
|
||||
if !args.Noop {
|
||||
repo, err := gh.CreateRepository(project, flagCreateDescription, flagCreateHomepage, flagCreatePrivate)
|
||||
|
|
Загрузка…
Ссылка в новой задаче