MCPcopy Create free account
hub / github.com/gogs/gogs / cloneLink

Method cloneLink

internal/database/repo.go:743–758  ·  view source on GitHub ↗

Deprecated: Use repoutil.NewCloneLink instead.

(isWiki bool)

Source from the content-addressed store, hash-verified

741
742// Deprecated: Use repoutil.NewCloneLink instead.
743func (r *Repository) cloneLink(isWiki bool) *repoutil.CloneLink {
744 repoName := r.Name
745 if isWiki {
746 repoName += ".wiki"
747 }
748
749 r.Owner = r.MustOwner()
750 cl := new(repoutil.CloneLink)
751 if conf.SSH.Port != 22 {
752 cl.SSH = fmt.Sprintf("ssh://%s@%s:%d/%s/%s.git", conf.App.RunUser, conf.SSH.Domain, conf.SSH.Port, r.Owner.Name, repoName)
753 } else {
754 cl.SSH = fmt.Sprintf("%s@%s:%s/%s.git", conf.App.RunUser, conf.SSH.Domain, r.Owner.Name, repoName)
755 }
756 cl.HTTPS = repoutil.HTTPSCloneURL(r.Owner.Name, repoName)
757 return cl
758}
759
760// CloneLink returns clone URLs of repository.
761//

Callers 2

WikiCloneLinkMethod · 0.95
CloneLinkMethod · 0.95

Implementers 2

Repositoryinternal/database/repo.go
mailerRepointernal/database/issue_mail.go

Calls 2

MustOwnerMethod · 0.95
HTTPSCloneURLFunction · 0.92

Tested by

no test coverage detected