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

Commit 2a7c664

Browse files
committed
git: do not expose storage options in PlainOpen
Signed-off-by: Javi Fontan <jfontan@gmail.com>
1 parent d7e6cf5 commit 2a7c664

File tree

3 files changed

+1
-27
lines changed

3 files changed

+1
-27
lines changed

options.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99
"gopkg.in/src-d/go-git.v4/plumbing"
1010
"gopkg.in/src-d/go-git.v4/plumbing/object"
1111
"gopkg.in/src-d/go-git.v4/plumbing/protocol/packp/sideband"
12-
"gopkg.in/src-d/go-git.v4/plumbing/storer"
1312
"gopkg.in/src-d/go-git.v4/plumbing/transport"
1413
)
1514

@@ -429,9 +428,6 @@ func (o *GrepOptions) Validate(w *Worktree) error {
429428
// PlainOpenOptions describes how opening a plain repository should be
430429
// performed.
431430
type PlainOpenOptions struct {
432-
// Storage layer options.
433-
Storage storer.Options
434-
435431
// DetectDotGit defines whether parent directories should be
436432
// walked until a .git directory or file is found.
437433
DetectDotGit bool

repository.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ func PlainOpenWithOptions(path string, o *PlainOpenOptions) (*Repository, error)
251251
return nil, err
252252
}
253253

254-
s, err := filesystem.NewStorageWithOptions(dot, o.Storage)
254+
s, err := filesystem.NewStorage(dot)
255255
if err != nil {
256256
return nil, err
257257
}

repository_test.go

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -550,28 +550,6 @@ func (s *RepositorySuite) TestPlainOpenNotExistsDetectDotGit(c *C) {
550550
c.Assert(r, IsNil)
551551
}
552552

553-
func (s *RepositorySuite) TestPlainOpenStatic(c *C) {
554-
dir, err := ioutil.TempDir("", "plain-open")
555-
c.Assert(err, IsNil)
556-
defer os.RemoveAll(dir)
557-
558-
r, err := PlainInit(dir, true)
559-
c.Assert(err, IsNil)
560-
c.Assert(r, NotNil)
561-
562-
op := &PlainOpenOptions{
563-
Storage: storer.Options{Static: true},
564-
}
565-
566-
r, err = PlainOpenWithOptions(dir, op)
567-
c.Assert(err, IsNil)
568-
c.Assert(r, NotNil)
569-
570-
sto, ok := r.Storer.(*filesystem.Storage)
571-
c.Assert(ok, Equals, true)
572-
c.Assert(sto.Options.Static, Equals, true)
573-
}
574-
575553
func (s *RepositorySuite) TestPlainClone(c *C) {
576554
r, err := PlainClone(c.MkDir(), false, &CloneOptions{
577555
URL: s.GetBasicLocalRepositoryURL(),

0 commit comments

Comments
 (0)