summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-12-15 21:32:17 -0500
committerUnknwon <u@gogs.io>2015-12-15 21:32:17 -0500
commit7786cb76f3bfc87f92aaae5cc70cbfa974b76868 (patch)
treed16534f5f831527d6efacd7f468bd408172a5d97 /models
parenteb918c2368afe4ceba43e09fe199b126de56e4fd (diff)
downloadgitea-7786cb76f3bfc87f92aaae5cc70cbfa974b76868.tar.gz
gitea-7786cb76f3bfc87f92aaae5cc70cbfa974b76868.zip
fix #2205
Diffstat (limited to 'models')
-rw-r--r--models/repo.go16
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)
+ }
}
}