aboutsummaryrefslogtreecommitdiffstats
path: root/modules/git/notes_nogogit.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/git/notes_nogogit.go')
-rw-r--r--modules/git/notes_nogogit.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/modules/git/notes_nogogit.go b/modules/git/notes_nogogit.go
index 1379e50853..d5d194b23f 100644
--- a/modules/git/notes_nogogit.go
+++ b/modules/git/notes_nogogit.go
@@ -43,11 +43,18 @@ func GetNote(repo *Repository, commitID string, note *Note) error {
if err != nil {
return err
}
- defer dataRc.Close()
+ closed := false
+ defer func() {
+ if !closed {
+ _ = dataRc.Close()
+ }
+ }()
d, err := ioutil.ReadAll(dataRc)
if err != nil {
return err
}
+ _ = dataRc.Close()
+ closed = true
note.Message = d
treePath := ""