(repo repository.RepoCommon)
| 431 | } |
| 432 | |
| 433 | func getValidGithubRemoteURLs(repo repository.RepoCommon) ([]string, error) { |
| 434 | remotes, err := repo.GetRemotes() |
| 435 | if err != nil { |
| 436 | return nil, err |
| 437 | } |
| 438 | |
| 439 | urls := make([]string, 0, len(remotes)) |
| 440 | for _, url := range remotes { |
| 441 | // split url can work again with shortURL |
| 442 | owner, project, err := splitURL(url) |
| 443 | if err == nil { |
| 444 | shortURL := fmt.Sprintf("%s/%s/%s", "github.com", owner, project) |
| 445 | urls = append(urls, shortURL) |
| 446 | } |
| 447 | } |
| 448 | |
| 449 | sort.Strings(urls) |
| 450 | |
| 451 | return urls, nil |
| 452 | } |
| 453 | |
| 454 | func promptLogin() (string, error) { |
| 455 | var login string |
no test coverage detected