0
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-07-21 12:24:38 +02:00
This commit is contained in:
Lunny Xiao 2025-03-16 13:14:16 -07:00
parent ce4f8f4f13
commit 153e898594
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A
2 changed files with 9 additions and 2 deletions

View File

@ -28,7 +28,7 @@ func OpenWikiRepository(ctx context.Context, repo Repository) (*git.Repository,
// IsWikiRepositoryExist returns true if the repository directory exists in the disk // IsWikiRepositoryExist returns true if the repository directory exists in the disk
func IsWikiRepositoryExist(ctx context.Context, repo Repository) (bool, error) { func IsWikiRepositoryExist(ctx context.Context, repo Repository) (bool, error) {
return util.IsExist(wikiPath(repo)) return util.IsDir(wikiPath(repo))
} }
// RenameRepository renames a repository's name on disk // RenameRepository renames a repository's name on disk

View File

@ -365,7 +365,14 @@ func DeleteWiki(ctx context.Context, repo *repo_model.Repository) error {
return err return err
} }
system_model.RemoveAllWithNotice(ctx, "Delete repository wiki", repo.WikiPath()) if err := gitrepo.DeleteWikiRepository(ctx, repo); err != nil {
desc := fmt.Sprintf("Delete wiki repository files [%s]: %v", repo.FullName(), err)
// Note we use the db.DefaultContext here rather than passing in a context as the context may be cancelled
if err = system_model.CreateNotice(db.DefaultContext, system_model.NoticeRepository, desc); err != nil {
log.Error("CreateRepositoryNotice: %v", err)
}
}
return nil return nil
} }