aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2022-02-06 07:11:35 +0000
committerGitHub <noreply@github.com>2022-02-06 15:11:35 +0800
commit9419dd2b62ab4399e4e7711a3ec4b81858883923 (patch)
tree8c64e07a926b3fc683bf21a28f3c4d37c16b95a8
parent3b33507c73cbc376fc078b87155978cc62564323 (diff)
downloadgitea-9419dd2b62ab4399e4e7711a3ec4b81858883923.tar.gz
gitea-9419dd2b62ab4399e4e7711a3ec4b81858883923.zip
Stop logging an error when notes are not found (#18626)
This is an unnecessary logging event. Fix #18616 Signed-off-by: Andrew Thornton <art27@cantab.net>
-rw-r--r--modules/git/notes_gogit.go3
-rw-r--r--modules/git/notes_nogogit.go3
2 files changed, 6 insertions, 0 deletions
diff --git a/modules/git/notes_gogit.go b/modules/git/notes_gogit.go
index 6cb719ce92..b1e5e453e4 100644
--- a/modules/git/notes_gogit.go
+++ b/modules/git/notes_gogit.go
@@ -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
}
diff --git a/modules/git/notes_nogogit.go b/modules/git/notes_nogogit.go
index 13b4b7b36a..bbc8ee1371 100644
--- a/modules/git/notes_nogogit.go
+++ b/modules/git/notes_nogogit.go
@@ -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
}