We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b116418 commit 15a1c2dCopy full SHA for 15a1c2d
routers/api/v1/repo/notes.go
@@ -58,8 +58,18 @@ func getNote(ctx *context.APIContext, identifier string) {
58
return
59
}
60
61
+ commitSHA, err := ctx.Repo.GitRepo.ConvertToSHA1(identifier)
62
+ if err != nil {
63
+ if git.IsErrNotExist(err) {
64
+ ctx.NotFound(err)
65
+ } else {
66
+ ctx.Error(http.StatusInternalServerError, "ConvertToSHA1", err)
67
+ }
68
+ return
69
70
+
71
var note git.Note
- if err := git.GetNote(ctx, ctx.Repo.GitRepo, identifier, ¬e); err != nil {
72
+ if err := git.GetNote(ctx, ctx.Repo.GitRepo, commitSHA.String(), ¬e); err != nil {
73
if git.IsErrNotExist(err) {
74
ctx.NotFound(identifier)
75
0 commit comments