-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove HasWiki method and use IsWikiRepositoryExist #33912
base: main
Are you sure you want to change the base?
Conversation
routers/web/repo/wiki.go
Outdated
hasWiki, err := gitrepo.IsWikiRepositoryExist(ctx, ctx.Repo.Repository) | ||
if err != nil { | ||
ctx.ServerError("IsWikiRepositoryExist", err) | ||
return | ||
} | ||
if !hasWiki { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks in previous design, error from util.IsDir
was ignored with a log be added, are you sure it's necessary to change this logic to return an 500 error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
util.IsDir
has checked os.IsNotExist(err)
, so I don't think the error should be ignored.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should stop here.
The design is wrong.
You can't make every function do "for repo" and "for wiki".
Since wiki is also a git repo, it should share the same repo interface as a code repo.
No description provided.