Remove local wiki copy on repo transfer. Fixes #2558

tokarchuk/v1.17
Josh Frye 9 years ago
parent 23bc9a2911
commit ce3708b3ea
  1. 1
      models/repo.go

@ -1103,6 +1103,7 @@ func TransferOwnership(u *User, newOwnerName string, repo *Repository) error {
wikiPath := WikiPath(owner.Name, repo.Name) wikiPath := WikiPath(owner.Name, repo.Name)
if com.IsExist(wikiPath) { if com.IsExist(wikiPath) {
RemoveAllWithNotice("Delete repository wiki local copy", repo.LocalWikiPath())
if err = os.Rename(wikiPath, WikiPath(newOwner.Name, repo.Name)); err != nil { if err = os.Rename(wikiPath, WikiPath(newOwner.Name, repo.Name)); err != nil {
return fmt.Errorf("rename repository wiki: %v", err) return fmt.Errorf("rename repository wiki: %v", err)
} }

Loading…
Cancel
Save