aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plumbing/storer/storer.go5
-rw-r--r--storage/filesystem/dotgit/dotgit.go10
-rw-r--r--storage/filesystem/storage_test.go2
3 files changed, 9 insertions, 8 deletions
diff --git a/plumbing/storer/storer.go b/plumbing/storer/storer.go
index 1b7d226..9bbb44f 100644
--- a/plumbing/storer/storer.go
+++ b/plumbing/storer/storer.go
@@ -16,6 +16,7 @@ type Initializer interface {
// Options holds configuration for the storage.
type Options struct {
- // Static means that the filesystem is not modified while the repo is open.
- Static bool
+ // ExclusiveAccess means that the filesystem is not modified externally
+ // while the repo is open.
+ ExclusiveAccess bool
}
diff --git a/storage/filesystem/dotgit/dotgit.go b/storage/filesystem/dotgit/dotgit.go
index c42ed88..7626078 100644
--- a/storage/filesystem/dotgit/dotgit.go
+++ b/storage/filesystem/dotgit/dotgit.go
@@ -165,7 +165,7 @@ func (d *DotGit) NewObjectPack() (*PackWriter, error) {
// ObjectPacks returns the list of availables packfiles
func (d *DotGit) ObjectPacks() ([]plumbing.Hash, error) {
- if !d.Static {
+ if !d.ExclusiveAccess {
return d.objectPacks()
}
@@ -279,7 +279,7 @@ func (d *DotGit) NewObject() (*ObjectWriter, error) {
// Objects returns a slice with the hashes of objects found under the
// .git/objects/ directory.
func (d *DotGit) Objects() ([]plumbing.Hash, error) {
- if d.Static {
+ if d.ExclusiveAccess {
err := d.genObjectList()
if err != nil {
return nil, err
@@ -302,7 +302,7 @@ func (d *DotGit) Objects() ([]plumbing.Hash, error) {
// ForEachObjectHash iterates over the hashes of objects found under the
// .git/objects/ directory and executes the provided function.
func (d *DotGit) ForEachObjectHash(fun func(plumbing.Hash) error) error {
- if !d.Static {
+ if !d.ExclusiveAccess {
return d.forEachObjectHash(fun)
}
@@ -376,7 +376,7 @@ func (d *DotGit) genObjectList() error {
}
func (d *DotGit) hasObject(h plumbing.Hash) error {
- if !d.Static {
+ if !d.ExclusiveAccess {
return nil
}
@@ -420,7 +420,7 @@ func (d *DotGit) genPackList() error {
}
func (d *DotGit) hasPack(h plumbing.Hash) error {
- if !d.Static {
+ if !d.ExclusiveAccess {
return nil
}
diff --git a/storage/filesystem/storage_test.go b/storage/filesystem/storage_test.go
index 23628c7..11bf4fc 100644
--- a/storage/filesystem/storage_test.go
+++ b/storage/filesystem/storage_test.go
@@ -66,7 +66,7 @@ func (s *StorageStaticSuite) SetUpTest(c *C) {
s.dir = c.MkDir()
storage, err := NewStorageWithOptions(
osfs.New(s.dir),
- storer.Options{Static: true})
+ storer.Options{ExclusiveAccess: true})
c.Assert(err, IsNil)
setUpTest(&s.StorageSuite, c, storage)