| 93 | } |
| 94 | |
| 95 | func FormatRemoteURL(repo Interface, protocol string) string { |
| 96 | if protocol == "ssh" { |
| 97 | if tenant, found := ghinstance.TenantName(repo.RepoHost()); found { |
| 98 | return fmt.Sprintf("%s@%s:%s/%s.git", tenant, repo.RepoHost(), repo.RepoOwner(), repo.RepoName()) |
| 99 | } |
| 100 | return fmt.Sprintf("git@%s:%s/%s.git", repo.RepoHost(), repo.RepoOwner(), repo.RepoName()) |
| 101 | } |
| 102 | return fmt.Sprintf("%s%s/%s.git", ghinstance.HostPrefix(repo.RepoHost()), repo.RepoOwner(), repo.RepoName()) |
| 103 | } |
| 104 | |
| 105 | type ghRepo struct { |
| 106 | owner string |