-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Getting notes of a tag via API triggers panic #23357
Comments
lunny
pushed a commit
that referenced
this issue
Mar 8, 2023
Fix #23357 . Now the `/repos/{owner}/{repo}/git/notes/{sha}` API supports getting notes by a ref or sha (https://try.gitea.io/api/swagger#/repository/repoGetNote). But the `GetNote` func can only accept commit ID. https://github.com/go-gitea/gitea/blob/a12f5757372f751d25f9e5ca1f168f6920ded894/modules/git/notes_nogogit.go#L18 So we need to convert the query parameter to commit ID before calling `GetNote`.
GiteaBot
pushed a commit
to GiteaBot/gitea
that referenced
this issue
Mar 8, 2023
Fix go-gitea#23357 . Now the `/repos/{owner}/{repo}/git/notes/{sha}` API supports getting notes by a ref or sha (https://try.gitea.io/api/swagger#/repository/repoGetNote). But the `GetNote` func can only accept commit ID. https://github.com/go-gitea/gitea/blob/a12f5757372f751d25f9e5ca1f168f6920ded894/modules/git/notes_nogogit.go#L18 So we need to convert the query parameter to commit ID before calling `GetNote`.
techknowlogick
added a commit
that referenced
this issue
Mar 8, 2023
Backport #23372 Fix #23357 . Now the `/repos/{owner}/{repo}/git/notes/{sha}` API supports getting notes by a ref or sha (https://try.gitea.io/api/swagger#/repository/repoGetNote). But the `GetNote` func can only accept commit ID. https://github.com/go-gitea/gitea/blob/a12f5757372f751d25f9e5ca1f168f6920ded894/modules/git/notes_nogogit.go#L18 So we need to convert the query parameter to commit ID before calling `GetNote`. Co-authored-by: Zettat123 <zettat123@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Description
Hi,
I've been experimenting with
git notes
and noticed that notes on tags are not properly handled. See this link: https://try.gitea.io/api/v1/repos/wiktor/dks/git/notes/v1It triggers the following panic:
I think the code assumes notes are only for commits and tries to get the Tree but Tags don't have it.
Gitea Version
1.20.0+dev-101-g84a299310
Can you reproduce the bug on the Gitea demo site?
Yes
Log Gist
No response
Screenshots
No response
Git Version
No response
Operating System
No response
How are you running Gitea?
Locally and via try.gitea.io
Database
None
The text was updated successfully, but these errors were encountered: