summaryrefslogtreecommitdiffstats
path: root/modules/repository
diff options
context:
space:
mode:
authoryisiliang <yisiliang@foxmail.com>2020-07-06 10:08:32 +0800
committerGitHub <noreply@github.com>2020-07-05 22:08:32 -0400
commit9fc9c1de98aff0329f358753ba5b2635dd522ac3 (patch)
tree7850d9aef1ed851d83fa3c1ba1f9dd4201dd3bd7 /modules/repository
parentc5b08f6d5a73e6ba84da84e804d05a8dd3d651be (diff)
downloadgitea-9fc9c1de98aff0329f358753ba5b2635dd522ac3.tar.gz
gitea-9fc9c1de98aff0329f358753ba5b2635dd522ac3.zip
Update the wiki repository remote origin while update the mirror repository's Clone From URL (#12053)
* update the wiki repository remote origin #12050 * wikiRemoteURL is under repo_module * export WikiRemoteURL func * remove redundant space and empty line Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'modules/repository')
-rw-r--r--modules/repository/repo.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/repository/repo.go b/modules/repository/repo.go
index d57b16c913..01d4701c71 100644
--- a/modules/repository/repo.go
+++ b/modules/repository/repo.go
@@ -27,9 +27,9 @@ import (
*/
var commonWikiURLSuffixes = []string{".wiki.git", ".git/wiki"}
-// wikiRemoteURL returns accessible repository URL for wiki if exists.
+// WikiRemoteURL returns accessible repository URL for wiki if exists.
// Otherwise, it returns an empty string.
-func wikiRemoteURL(remote string) string {
+func WikiRemoteURL(remote string) string {
remote = strings.TrimSuffix(remote, ".git")
for _, suffix := range commonWikiURLSuffixes {
wikiURL := remote + suffix
@@ -71,7 +71,7 @@ func MigrateRepositoryGitData(doer, u *models.User, repo *models.Repository, opt
if opts.Wiki {
wikiPath := models.WikiPath(u.Name, opts.RepoName)
- wikiRemotePath := wikiRemoteURL(opts.CloneAddr)
+ wikiRemotePath := WikiRemoteURL(opts.CloneAddr)
if len(wikiRemotePath) > 0 {
if err := os.RemoveAll(wikiPath); err != nil {
return repo, fmt.Errorf("Failed to remove %s: %v", wikiPath, err)