]> source.dussan.org Git - gitea.git/commit
Fix panic when getting notes by ref (#23372)
authorZettat123 <zettat123@gmail.com>
Wed, 8 Mar 2023 12:21:23 +0000 (20:21 +0800)
committerGitHub <noreply@github.com>
Wed, 8 Mar 2023 12:21:23 +0000 (20:21 +0800)
commit15a1c2d7efa2c835fb9bcff439446579f08c5e32
tree27cfcad01133151fb162b3ba905d29cf105d5d51
parentb116418f05b822481bba3613873eef876da73814
Fix panic when getting notes by ref (#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`.
routers/api/v1/repo/notes.go