Skip to content

Commit 153e898

Browse files
committed
Fix
1 parent ce4f8f4 commit 153e898

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

modules/gitrepo/wiki.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func OpenWikiRepository(ctx context.Context, repo Repository) (*git.Repository,
2828

2929
// IsWikiRepositoryExist returns true if the repository directory exists in the disk
3030
func IsWikiRepositoryExist(ctx context.Context, repo Repository) (bool, error) {
31-
return util.IsExist(wikiPath(repo))
31+
return util.IsDir(wikiPath(repo))
3232
}
3333

3434
// RenameRepository renames a repository's name on disk

services/wiki/wiki.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,14 @@ func DeleteWiki(ctx context.Context, repo *repo_model.Repository) error {
365365
return err
366366
}
367367

368-
system_model.RemoveAllWithNotice(ctx, "Delete repository wiki", repo.WikiPath())
368+
if err := gitrepo.DeleteWikiRepository(ctx, repo); err != nil {
369+
desc := fmt.Sprintf("Delete wiki repository files [%s]: %v", repo.FullName(), err)
370+
// Note we use the db.DefaultContext here rather than passing in a context as the context may be cancelled
371+
if err = system_model.CreateNotice(db.DefaultContext, system_model.NoticeRepository, desc); err != nil {
372+
log.Error("CreateRepositoryNotice: %v", err)
373+
}
374+
}
375+
369376
return nil
370377
}
371378

0 commit comments

Comments
 (0)