Skip to content

Commit ae91913

Browse files
lunnyzeripath
andauthored
Only log non ErrNotExist errors in git.GetNote (#19884) (#19905)
* Fix GetNote * Only log errors if the error is not ErrNotExist Signed-off-by: Andrew Thornton <[email protected]> Co-authored-by: Andrew Thornton <[email protected]> Co-authored-by: Andrew Thornton <[email protected]>
1 parent 0e77911 commit ae91913

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

modules/git/notes_nogogit.go

Lines changed: 4 additions & 1 deletion
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)