aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/format/gitattributes/dir.go
diff options
context:
space:
mode:
authorPeter Kurfer <peter@icb4dc0.de>2024-02-02 13:55:42 +0100
committerPeter Kurfer <peter@icb4dc0.de>2024-02-05 10:28:25 +0100
commit798d9942c3625d88146d5e1c026afe6192acc98d (patch)
treec29b740c9e2b9fce207c8997b4bb271d9e591c5a /plumbing/format/gitattributes/dir.go
parent03a57f8f5179a990083e8b9c2c9e40854ae402ea (diff)
downloadgo-git-798d9942c3625d88146d5e1c026afe6192acc98d.tar.gz
plumbing: format/gitattributes, close file in ReadAttributesFile
Fixes #1017
Diffstat (limited to 'plumbing/format/gitattributes/dir.go')
-rw-r--r--plumbing/format/gitattributes/dir.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/plumbing/format/gitattributes/dir.go b/plumbing/format/gitattributes/dir.go
index 123fe25..d3b0dbe 100644
--- a/plumbing/format/gitattributes/dir.go
+++ b/plumbing/format/gitattributes/dir.go
@@ -4,6 +4,7 @@ import (
"os"
"github.com/go-git/go-billy/v5"
+
"github.com/go-git/go-git/v5/plumbing/format/config"
gioutil "github.com/go-git/go-git/v5/utils/ioutil"
)
@@ -26,6 +27,8 @@ func ReadAttributesFile(fs billy.Filesystem, path []string, attributesFile strin
return nil, err
}
+ defer gioutil.CheckClose(f, &err)
+
return ReadAttributes(f, path, allowMacro)
}