Skip to content

Commit

Permalink
Stop logging an error when notes are not found (#18626) (#18635)
Browse files Browse the repository at this point in the history
Backport #18626

This is an unnecessary logging event.

Fix #18616

Signed-off-by: Andrew Thornton <art27@cantab.net>
  • Loading branch information
zeripath authored Feb 6, 2022
1 parent 36c6630 commit a13fb15
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions modules/git/notes_gogit.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ func GetNote(ctx context.Context, repo *Repository, commitID string, note *Note)
log.Trace("Searching for git note corresponding to the commit %q in the repository %q", commitID, repo.Path)
notes, err := repo.GetCommit(NotesRef)
if err != nil {
if IsErrNotExist(err) {
return err
}
log.Error("Unable to get commit from ref %q. Error: %v", NotesRef, err)
return err
}
Expand Down
3 changes: 3 additions & 0 deletions modules/git/notes_nogogit.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ func GetNote(ctx context.Context, repo *Repository, commitID string, note *Note)
log.Trace("Searching for git note corresponding to the commit %q in the repository %q", commitID, repo.Path)
notes, err := repo.GetCommit(NotesRef)
if err != nil {
if IsErrNotExist(err) {
return err
}
log.Error("Unable to get commit from ref %q. Error: %v", NotesRef, err)
return err
}
Expand Down

0 comments on commit a13fb15

Please sign in to comment.