aboutsummaryrefslogtreecommitdiffstats
path: root/storage/filesystem/object.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2018-09-04 12:06:44 +0200
committerGitHub <noreply@github.com>2018-09-04 12:06:44 +0200
commit2f1583896bcc3c182d8165d6aeeb23c771cc5417 (patch)
tree883c48f088d16ef07c97fdb93888c5947df994f4 /storage/filesystem/object.go
parent8e76874ae2a3f5029269af76a86f0ee294699df9 (diff)
parent659ec443b4a975e3adf78f24e59ad69d210d2c0b (diff)
downloadgo-git-2f1583896bcc3c182d8165d6aeeb23c771cc5417.tar.gz
Merge pull request #941 from jfontan/improvement/static-mode
plumbing/storer: add ExclusiveAccess option to Storer
Diffstat (limited to 'storage/filesystem/object.go')
-rw-r--r--storage/filesystem/object.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/storage/filesystem/object.go b/storage/filesystem/object.go
index 3a3a2bd..3519385 100644
--- a/storage/filesystem/object.go
+++ b/storage/filesystem/object.go
@@ -18,6 +18,8 @@ import (
)
type ObjectStorage struct {
+ options Options
+
// deltaBaseCache is an object cache uses to cache delta's bases when
deltaBaseCache cache.Object
@@ -27,7 +29,17 @@ type ObjectStorage struct {
// NewObjectStorage creates a new ObjectStorage with the given .git directory.
func NewObjectStorage(dir *dotgit.DotGit) (ObjectStorage, error) {
+ return NewObjectStorageWithOptions(dir, Options{})
+}
+
+// NewObjectStorageWithOptions creates a new ObjectStorage with the given .git
+// directory and sets its options.
+func NewObjectStorageWithOptions(
+ dir *dotgit.DotGit,
+ ops Options,
+) (ObjectStorage, error) {
s := ObjectStorage{
+ options: ops,
deltaBaseCache: cache.NewObjectLRUDefault(),
dir: dir,
}