-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
ListBranches should handle empty case #21910
Comments
zeripath
pushed a commit
that referenced
this issue
Dec 4, 2022
Fix #21910 Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
lunny
added a commit
to lunny/gitea
that referenced
this issue
Dec 4, 2022
Fix go-gitea#21910 Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
lunny
added a commit
to lunny/gitea
that referenced
this issue
Dec 4, 2022
Fix go-gitea#21910 Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
This was referenced Dec 4, 2022
lafriks
pushed a commit
that referenced
this issue
Dec 4, 2022
techknowlogick
pushed a commit
that referenced
this issue
Dec 4, 2022
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Description
We are trying to add Automatic Branch Protection on master branch because #2529 is not going away soon because #20825 is still a work in progress, we are doing it ourselves via Webhook. I know that I should do it on the very first commit but I have noticed there is a panic when calling ListBranches on an empty, totally new Gitea repo:
Which starts from here:
gitea/routers/api/v1/repo/branch.go
Lines 257 to 261 in 044c754
We are using it to detect
main/master
and it seems like rather than returning[]
it assumed a "Git" repo would exist but it is not yet because the first commit is not set.Gitea Version
866f567
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Screenshots
No response
Git Version
No response
Operating System
No response
How are you running Gitea?
I built this version of my own PR here: #21780
Database
SQLite
The text was updated successfully, but these errors were encountered: