Skip to content

Commit 961cfd7

Browse files
lunnyzeripath
andcommitted
Only log non ErrNotExist errors in git.GetNote (go-gitea#19884)
* Fix GetNote * Only log errors if the error is not ErrNotExist Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Andrew Thornton <art27@cantab.net>
1 parent 0e77911 commit 961cfd7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

modules/git/notes_nogogit.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ func GetNote(ctx context.Context, repo *Repository, commitID string, note *Note)
4747
commitID = commitID[2:]
4848
}
4949
if err != nil {
50-
log.Error("Unable to find git note corresponding to the commit %q. Error: %v", originalCommitID, err)
50+
// Err may have been updated by the SubTree we need to recheck if it's again an ErrNotExist
51+
if !IsErrNotExist(err) {
52+
log.Error("Unable to find git note corresponding to the commit %q. Error: %v", originalCommitID, err)
53+
}
5154
return err
5255
}
5356
}

0 commit comments

Comments
 (0)