summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2022-06-07 16:39:50 +0800
committerGitHub <noreply@github.com>2022-06-07 16:39:50 +0800
commitdbe415fb917db502ddb7d73acd027606b0b4756f (patch)
treeb5cb6cd9145a6b6b12615dfca7845d5060c58938
parent23dd0f34561887a6df880789c29d69a1488dec7a (diff)
downloadgitea-dbe415fb917db502ddb7d73acd027606b0b4756f.tar.gz
gitea-dbe415fb917db502ddb7d73acd027606b0b4756f.zip
Only log non ErrNotExist errors in git.GetNote (#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>
-rw-r--r--modules/git/notes_nogogit.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/git/notes_nogogit.go b/modules/git/notes_nogogit.go
index e3f0a3fee9..1476805dcd 100644
--- a/modules/git/notes_nogogit.go
+++ b/modules/git/notes_nogogit.go
@@ -46,7 +46,10 @@ func GetNote(ctx context.Context, repo *Repository, commitID string, note *Note)
commitID = commitID[2:]
}
if err != nil {
- log.Error("Unable to find git note corresponding to the commit %q. Error: %v", originalCommitID, err)
+ // Err may have been updated by the SubTree we need to recheck if it's again an ErrNotExist
+ if !IsErrNotExist(err) {
+ log.Error("Unable to find git note corresponding to the commit %q. Error: %v", originalCommitID, err)
+ }
return err
}
}