mirror of
https://github.com/go-gitea/gitea.git
synced 2025-07-17 13:12:53 +02:00
Fix
This commit is contained in:
parent
ce4f8f4f13
commit
153e898594
@ -28,7 +28,7 @@ func OpenWikiRepository(ctx context.Context, repo Repository) (*git.Repository,
|
||||
|
||||
// IsWikiRepositoryExist returns true if the repository directory exists in the disk
|
||||
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
|
||||
|
@ -365,7 +365,14 @@ func DeleteWiki(ctx context.Context, repo *repo_model.Repository) error {
|
||||
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
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user