Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Commit cf62667

Browse files
committed
plumbing/storer: rename Static option to ExclusiveAccess
Signed-off-by: Javi Fontan <jfontan@gmail.com>
1 parent 2a7c664 commit cf62667

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

plumbing/storer/storer.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ type Initializer interface {
1616

1717
// Options holds configuration for the storage.
1818
type Options struct {
19-
// Static means that the filesystem is not modified while the repo is open.
20-
Static bool
19+
// ExclusiveAccess means that the filesystem is not modified externally
20+
// while the repo is open.
21+
ExclusiveAccess bool
2122
}

storage/filesystem/dotgit/dotgit.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ func (d *DotGit) NewObjectPack() (*PackWriter, error) {
165165

166166
// ObjectPacks returns the list of availables packfiles
167167
func (d *DotGit) ObjectPacks() ([]plumbing.Hash, error) {
168-
if !d.Static {
168+
if !d.ExclusiveAccess {
169169
return d.objectPacks()
170170
}
171171

@@ -279,7 +279,7 @@ func (d *DotGit) NewObject() (*ObjectWriter, error) {
279279
// Objects returns a slice with the hashes of objects found under the
280280
// .git/objects/ directory.
281281
func (d *DotGit) Objects() ([]plumbing.Hash, error) {
282-
if d.Static {
282+
if d.ExclusiveAccess {
283283
err := d.genObjectList()
284284
if err != nil {
285285
return nil, err
@@ -302,7 +302,7 @@ func (d *DotGit) Objects() ([]plumbing.Hash, error) {
302302
// ForEachObjectHash iterates over the hashes of objects found under the
303303
// .git/objects/ directory and executes the provided function.
304304
func (d *DotGit) ForEachObjectHash(fun func(plumbing.Hash) error) error {
305-
if !d.Static {
305+
if !d.ExclusiveAccess {
306306
return d.forEachObjectHash(fun)
307307
}
308308

@@ -376,7 +376,7 @@ func (d *DotGit) genObjectList() error {
376376
}
377377

378378
func (d *DotGit) hasObject(h plumbing.Hash) error {
379-
if !d.Static {
379+
if !d.ExclusiveAccess {
380380
return nil
381381
}
382382

@@ -420,7 +420,7 @@ func (d *DotGit) genPackList() error {
420420
}
421421

422422
func (d *DotGit) hasPack(h plumbing.Hash) error {
423-
if !d.Static {
423+
if !d.ExclusiveAccess {
424424
return nil
425425
}
426426

storage/filesystem/storage_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func (s *StorageStaticSuite) SetUpTest(c *C) {
6666
s.dir = c.MkDir()
6767
storage, err := NewStorageWithOptions(
6868
osfs.New(s.dir),
69-
storer.Options{Static: true})
69+
storer.Options{ExclusiveAccess: true})
7070
c.Assert(err, IsNil)
7171

7272
setUpTest(&s.StorageSuite, c, storage)

0 commit comments

Comments
 (0)