mirror of
https://github.com/go-gitea/gitea.git
synced 2025-09-28 12:58:31 +00:00
Move HasWiki to repository service package (#33912)
Move HasWiki out of the models package to avoid referencing the absolute wiki path directly.
This commit is contained in:
@@ -315,9 +315,13 @@ func DeleteRepositoryDirectly(ctx context.Context, repoID int64, ignoreOrgTeams
|
||||
}
|
||||
}
|
||||
|
||||
// Remove wiki files
|
||||
if repo.HasWiki() {
|
||||
system_model.RemoveAllWithNotice(ctx, "Delete repository wiki", repo.WikiPath())
|
||||
// Remove wiki files if it exists.
|
||||
if err := gitrepo.DeleteRepository(ctx, repo.WikiStorageRepo()); 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(graceful.GetManager().ShutdownContext(), system_model.NoticeRepository, desc); err != nil {
|
||||
log.Error("CreateRepositoryNotice: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
// Remove archives
|
||||
|
Reference in New Issue
Block a user