@ -27,9 +27,9 @@ import (
* /
* /
var commonWikiURLSuffixes = [ ] string { ".wiki.git" , ".git/wiki" }
var commonWikiURLSuffixes = [ ] string { ".wiki.git" , ".git/wiki" }
// w ikiRemoteURL returns accessible repository URL for wiki if exists.
// W ikiRemoteURL returns accessible repository URL for wiki if exists.
// Otherwise, it returns an empty string.
// Otherwise, it returns an empty string.
func w ikiRemoteURL( remote string ) string {
func W ikiRemoteURL( remote string ) string {
remote = strings . TrimSuffix ( remote , ".git" )
remote = strings . TrimSuffix ( remote , ".git" )
for _ , suffix := range commonWikiURLSuffixes {
for _ , suffix := range commonWikiURLSuffixes {
wikiURL := remote + suffix
wikiURL := remote + suffix
@ -71,7 +71,7 @@ func MigrateRepositoryGitData(doer, u *models.User, repo *models.Repository, opt
if opts . Wiki {
if opts . Wiki {
wikiPath := models . WikiPath ( u . Name , opts . RepoName )
wikiPath := models . WikiPath ( u . Name , opts . RepoName )
wikiRemotePath := w ikiRemoteURL( opts . CloneAddr )
wikiRemotePath := W ikiRemoteURL( opts . CloneAddr )
if len ( wikiRemotePath ) > 0 {
if len ( wikiRemotePath ) > 0 {
if err := os . RemoveAll ( wikiPath ) ; err != nil {
if err := os . RemoveAll ( wikiPath ) ; err != nil {
return repo , fmt . Errorf ( "Failed to remove %s: %v" , wikiPath , err )
return repo , fmt . Errorf ( "Failed to remove %s: %v" , wikiPath , err )