diff options
Diffstat (limited to 'models/repo.go')
-rw-r--r-- | models/repo.go | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/models/repo.go b/models/repo.go index 82e3463377..976dcabf59 100644 --- a/models/repo.go +++ b/models/repo.go @@ -129,6 +129,8 @@ func NewRepoContext() { log.Fatal(4, "Fail to execute 'git config --global core.quotepath false': %s", stderr) } + // Clean up temporary data. + os.RemoveAll(filepath.Join(setting.AppDataPath, "tmp")) } // Repository represents a git repository. @@ -1301,12 +1303,14 @@ func DeleteRepository(uid, repoID int64) error { } } - wikiPath := repo.WikiPath() - if err = os.RemoveAll(wikiPath); err != nil { - desc := fmt.Sprintf("delete repository wiki [%s]: %v", wikiPath, err) - log.Warn(desc) - if err = CreateRepositoryNotice(desc); err != nil { - log.Error(4, "CreateRepositoryNotice: %v", err) + wikiPaths := []string{repo.WikiPath(), repo.LocalWikiPath()} + for _, wikiPath := range wikiPaths { + if err = os.RemoveAll(wikiPath); err != nil { + desc := fmt.Sprintf("delete repository wiki [%s]: %v", wikiPath, err) + log.Warn(desc) + if err = CreateRepositoryNotice(desc); err != nil { + log.Error(4, "CreateRepositoryNotice: %v", err) + } } } |