Skip to content
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

Fix possible panic when repository is empty #20509

Merged
merged 2 commits into from
Jul 27, 2022

Conversation

lunny
Copy link
Member

@lunny lunny commented Jul 27, 2022

No description provided.

@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Jul 27, 2022
@wxiaoguang
Copy link
Contributor

wxiaoguang commented Jul 27, 2022

If I understand correctly, is there still another case can cause some panics: what if the IsEmpty=false, but the repo directory doesn't exist? (maybe such case has been handled correctly, I am just curious about this)


Update: just did a test, all are fine after this PR's fix. Gitea will report "The Git data underlying this repository cannot be read. Contact the administrator of this instance or delete this repository." correctly.

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jul 27, 2022
@wxiaoguang wxiaoguang merged commit 6554d51 into go-gitea:main Jul 27, 2022
zjjhot added a commit to zjjhot/gitea that referenced this pull request Jul 28, 2022
* giteaofficial/main:
  Removed some vestigial code related to Range bounds checks (go-gitea#20312)
  Add markdownlint (go-gitea#20512)
  Fix possible panic when repository is empty (go-gitea#20509)
  patch (doc): add heading to ssh flow explanation (go-gitea#20506)
  Show hint to link package to repo when viewing empty repo package list (go-gitea#20504)
  Fix ROOT_URL detection for URLs without trailing slash (go-gitea#20502)
  Add Tar ZSTD support (go-gitea#20493)
6543 pushed a commit to 6543-forks/gitea that referenced this pull request Jul 28, 2022
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
6543 pushed a commit to 6543-forks/gitea that referenced this pull request Jul 28, 2022
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
@6543
Copy link
Member

6543 commented Jul 28, 2022

-> #20527

@6543 6543 added the backport/done All backports for this PR have been created label Jul 28, 2022
@6543
Copy link
Member

6543 commented Jul 28, 2022

-> #20526

zeripath pushed a commit that referenced this pull request Jul 28, 2022
@lunny lunny deleted the lunny/fix_empty_repo branch July 29, 2022 01:32
vsysoev pushed a commit to IntegraSDL/gitea that referenced this pull request Aug 10, 2022
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
@wxiaoguang wxiaoguang added this to the 1.18.0 milestone Oct 7, 2022
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/done All backports for this PR have been created lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants