Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
forgefriends
Forgefriends
Commits
8c1a9a51
Verified
Commit
8c1a9a51
authored
Dec 23, 2021
by
Loïc Dachary
Browse files
repository: cloneLink(suffix) instead of cloneLink(isWiki)
Signed-off-by:
Loïc Dachary
<
loic@dachary.org
>
parent
08568d81
Changes
2
Hide whitespace changes
Inline
Side-by-side
models/repo/repo.go
View file @
8c1a9a51
...
...
@@ -509,11 +509,8 @@ func ComposeHTTPSCloneURL(owner, repo string) string {
return
fmt
.
Sprintf
(
"%s%s/%s.git"
,
setting
.
AppURL
,
url
.
PathEscape
(
owner
),
url
.
PathEscape
(
repo
))
}
func
(
repo
*
Repository
)
cloneLink
(
isWiki
bool
)
*
CloneLink
{
repoName
:=
repo
.
Name
if
isWiki
{
repoName
+=
".wiki"
}
func
(
repo
*
Repository
)
cloneLink
(
suffix
string
)
*
CloneLink
{
repoName
:=
repo
.
Name
+
suffix
sshUser
:=
setting
.
RunUser
if
setting
.
SSH
.
StartBuiltinServer
{
...
...
@@ -543,7 +540,7 @@ func (repo *Repository) cloneLink(isWiki bool) *CloneLink {
// CloneLink returns clone URLs of repository.
func
(
repo
*
Repository
)
CloneLink
()
(
cl
*
CloneLink
)
{
return
repo
.
cloneLink
(
false
)
return
repo
.
cloneLink
(
""
)
}
// GetOriginalURLHostname returns the hostname of a URL or the URL
...
...
models/repo/wiki.go
View file @
8c1a9a51
...
...
@@ -16,7 +16,7 @@ import (
// WikiCloneLink returns clone URLs of repository wiki.
func
(
repo
*
Repository
)
WikiCloneLink
()
*
CloneLink
{
return
repo
.
cloneLink
(
true
)
return
repo
.
cloneLink
(
".wiki"
)
}
// WikiPath returns wiki data path by given user and repository name.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment