mirror of
https://github.com/go-gitea/gitea
synced 2025-07-15 23:17:19 +00:00
Add UseCompatSSHURI setting (#2356)
* Add UseCompatSSHURI setting Signed-off-by: Manuel Kroeber <manuel.kroeber@gmail.com> (+1 squashed commits) Squashed commits: [dda2dc79] Add ForceCloneSSHURL setting Signed-off-by: Manuel Kroeber <manuel.kroeber@gmail.com> * Make protocol if construct more readable Signed-off-by: Manuel Kroeber <manuel.kroeber@gmail.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
// Copyright 2014 The Gogs Authors. All rights reserved.
|
||||
// Copyright 2017 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
@@ -791,6 +792,8 @@ func (repo *Repository) cloneLink(isWiki bool) *CloneLink {
|
||||
cl := new(CloneLink)
|
||||
if setting.SSH.Port != 22 {
|
||||
cl.SSH = fmt.Sprintf("ssh://%s@%s:%d/%s/%s.git", setting.RunUser, setting.SSH.Domain, setting.SSH.Port, repo.Owner.Name, repoName)
|
||||
} else if setting.Repository.UseCompatSSHURI {
|
||||
cl.SSH = fmt.Sprintf("ssh://%s@%s/%s/%s.git", setting.RunUser, setting.SSH.Domain, repo.Owner.Name, repoName)
|
||||
} else {
|
||||
cl.SSH = fmt.Sprintf("%s@%s:%s/%s.git", setting.RunUser, setting.SSH.Domain, repo.Owner.Name, repoName)
|
||||
}
|
||||
|
Reference in New Issue
Block a user