-
-
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
Use gitrepo.SetDefaultBranch when set default branch of wiki repository #33911
base: main
Are you sure you want to change the base?
Conversation
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.
services/repository/transfer.go
Outdated
repo_model.StorageRepo(repo_model.RelativePath(repo.OwnerName, newRepoName))); err != nil { | ||
repo_model.StorageRepo{ | ||
RelativePath: repo_model.RelativePath(repo.OwnerName, newRepoName), | ||
DefaultBranch: repo.DefaultBranch, |
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.
If DefaultBranch
is a required field, then you can't expose it or let the callers pass it.
In the future, if someone forgets to set DefaultBranch
, there will be a lot of new bugs.
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.
The design of StorageRepo is buggy and will cause more abuses or bugs.
Updated to revert the new interface of the |
No description provided.