diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2018-09-06 21:54:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-06 21:54:08 +0200 |
commit | 174f373cf066afc3e3be35576adf3709b0ee278b (patch) | |
tree | 22341a6315f5a0df6f1b0a5821b6c319da28d519 /storage/filesystem/storage.go | |
parent | 2f1583896bcc3c182d8165d6aeeb23c771cc5417 (diff) | |
parent | 8176f084d861891d1846a2d46bf669d0d3463ebd (diff) | |
download | go-git-174f373cf066afc3e3be35576adf3709b0ee278b.tar.gz |
Merge pull request #942 from jfontan/improvement/maintain-packfiles-open
storage/dotgit: add KeepDescriptors option
Diffstat (limited to 'storage/filesystem/storage.go')
-rw-r--r-- | storage/filesystem/storage.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/storage/filesystem/storage.go b/storage/filesystem/storage.go index 25b3653..7fae789 100644 --- a/storage/filesystem/storage.go +++ b/storage/filesystem/storage.go @@ -27,6 +27,9 @@ type Options struct { // ExclusiveAccess means that the filesystem is not modified externally // while the repo is open. ExclusiveAccess bool + // KeepDescriptors makes the file descriptors to be reused but they will + // need to be manually closed calling Close(). + KeepDescriptors bool } // NewStorage returns a new Storage backed by a given `fs.Filesystem` @@ -41,6 +44,7 @@ func NewStorageWithOptions( ) (*Storage, error) { dirOps := dotgit.Options{ ExclusiveAccess: ops.ExclusiveAccess, + KeepDescriptors: ops.KeepDescriptors, } dir := dotgit.NewWithOptions(fs, dirOps) |