aboutsummaryrefslogtreecommitdiffstats
path: root/storage/filesystem/object.go
diff options
context:
space:
mode:
authorJavi Fontan <jfontan@gmail.com>2018-09-03 19:40:22 +0200
committerJavi Fontan <jfontan@gmail.com>2018-09-03 19:40:22 +0200
commit874f669becc25489081306bbbcbbc27b970f6295 (patch)
tree82a106646428b4656f4483afd7b38696eede2cbf /storage/filesystem/object.go
parent95acbf6c3958b7540a8549aa049051325fcecd8b (diff)
downloadgo-git-874f669becc25489081306bbbcbbc27b970f6295.tar.gz
storage/filesystem: move Options to filesytem and dotgit
Signed-off-by: Javi Fontan <jfontan@gmail.com>
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,
}