X Tutup
Skip to content

Commit 5f5df81

Browse files
committed
Fix generated URLs for github.localhost repositories
1 parent 2c86e67 commit 5f5df81

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/ghrepo/repo.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ func IsSame(a, b Interface) bool {
103103
}
104104

105105
func GenerateRepoURL(repo Interface, p string, args ...interface{}) string {
106-
baseURL := fmt.Sprintf("https://%s/%s/%s", repo.RepoHost(), repo.RepoOwner(), repo.RepoName())
106+
baseURL := fmt.Sprintf("%s%s/%s", ghinstance.HostPrefix(repo.RepoHost()), repo.RepoOwner(), repo.RepoName())
107107
if p != "" {
108108
return baseURL + "/" + fmt.Sprintf(p, args...)
109109
}
@@ -116,7 +116,7 @@ func FormatRemoteURL(repo Interface, protocol string) string {
116116
return fmt.Sprintf("git@%s:%s/%s.git", repo.RepoHost(), repo.RepoOwner(), repo.RepoName())
117117
}
118118

119-
return fmt.Sprintf("https://%s/%s/%s.git", repo.RepoHost(), repo.RepoOwner(), repo.RepoName())
119+
return fmt.Sprintf("%s%s/%s.git", ghinstance.HostPrefix(repo.RepoHost()), repo.RepoOwner(), repo.RepoName())
120120
}
121121

122122
type ghRepo struct {

0 commit comments

Comments
 (0)
X Tutup