-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
When the git repository on storage is changed, the repository modal should also be updated #18088
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
Conversation
ec99096
to
cb8b524
Compare
…hould also be updated.
cb8b524
to
d3888f8
Compare
Codecov Report
@@ Coverage Diff @@
## main #18088 +/- ##
=======================================
Coverage ? 44.89%
=======================================
Files ? 824
Lines ? 91575
Branches ? 0
=======================================
Hits ? 41114
Misses ? 43861
Partials ? 6600
Continue to review full report at Codecov.
|
TBH the IsEmpty flag is deeply broken and should be removed with the UI changed to manage to cope with empty repos. For example it's possible for a repository to be non-empty by that flag but still 500 because there are no branches - only tags -or the default branch is non-extant as it has been 0-pushed. |
That's very helpful. I added more comments there. |
d89310a
to
f6ebf80
Compare
…hould also be updated (go-gitea#18088) User would keep seeing an empty repo if: * An error occurs during the first git pushing/receiving * A user replaces the Gitea's empty repository manually Fix: when a user is viewing the repository web page, if the repoModal.IsEmpty is true, we check the git repository again to detect whether it is really empty. However: the IsEmpty flag is deeply broken and should be removed. For example it's possible for a repository to be non-empty by that flag but still 500 because there are no branches - only tags -or the default branch is non-extant as it has been 0-pushed.
I saw some issues about "after pushing the git repository to Gitea, the Gitea web still shows the repository is empty" (I can not remember the issue number now ....)
And I meet the same problem today. This problem would be caused by some cases:
The reason behind the problem is that the
repoModal.IsEmpty
is out of sync of the real status of the repo.This PR fixes the problem. When a user is viewing the repository web page, if the
repoModal.IsEmpty
is true, we check the git repository again to detect whether it is really empty.This PR was tested on my side, and I can view the non-empty git repository correctly now.
Maybe we should fix more inconsistent data, please help to review and suggest, thank you