diff options
author | Unknwon <u@gogs.io> | 2015-12-15 21:32:17 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-12-15 21:32:17 -0500 |
commit | 7786cb76f3bfc87f92aaae5cc70cbfa974b76868 (patch) | |
tree | d16534f5f831527d6efacd7f468bd408172a5d97 /models | |
parent | eb918c2368afe4ceba43e09fe199b126de56e4fd (diff) | |
download | gitea-7786cb76f3bfc87f92aaae5cc70cbfa974b76868.tar.gz gitea-7786cb76f3bfc87f92aaae5cc70cbfa974b76868.zip |
fix #2205
Diffstat (limited to 'models')
-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) + } } } |