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

Commit 1e53ff3

Browse files
authored
utils: fs, new memory filesystem (#108)
* utils: fs, new memory filesystem * utils: fs, renamed os.NewOS to os.New * utils: fs, memory changes requested by @alcortes
1 parent f1a0578 commit 1e53ff3

File tree

12 files changed

+442
-12
lines changed

12 files changed

+442
-12
lines changed

fixtures/fixtures.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ func (f *Fixture) DotGit() fs.Filesystem {
181181
}
182182

183183
folders = append(folders, path)
184-
return osfs.NewOS(path)
184+
return osfs.New(path)
185185
}
186186

187187
type Fixtures []*Fixture

remote_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ func (s *RemoteSuite) TestFetchObjectStorageWriter(c *C) {
101101
defer os.RemoveAll(dir) // clean up
102102

103103
var sto Storage
104-
sto, err = filesystem.NewStorage(osfs.NewOS(dir))
104+
sto, err = filesystem.NewStorage(osfs.New(dir))
105105
c.Assert(err, IsNil)
106106

107107
r := newRemote(sto, &config.RemoteConfig{Name: "foo", URL: RepositoryFixture})

repository.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func NewMemoryRepository() *Repository {
3333
// based on a fs.OS, if you want to use a custom one you need to use the function
3434
// NewRepository and build you filesystem.Storage
3535
func NewFilesystemRepository(path string) (*Repository, error) {
36-
s, err := filesystem.NewStorage(osfs.NewOS(path))
36+
s, err := filesystem.NewStorage(osfs.New(path))
3737
if err != nil {
3838
return nil, err
3939
}

storage/filesystem/config_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func (s *ConfigSuite) SetUpTest(c *C) {
2525
tmp, err := ioutil.TempDir("", "go-git-filestystem-config")
2626
c.Assert(err, IsNil)
2727

28-
s.dir = dotgit.New(os.NewOS(tmp))
28+
s.dir = dotgit.New(os.New(tmp))
2929
s.path = tmp
3030
}
3131

storage/filesystem/internal/dotgit/dotgit_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func (s *SuiteDotGit) TestSetRefs(c *C) {
2727
c.Assert(err, IsNil)
2828
defer os.RemoveAll(tmp)
2929

30-
fs := osfs.NewOS(tmp)
30+
fs := osfs.New(tmp)
3131
dir := New(fs)
3232

3333
err = dir.SetRef(core.NewReferenceFromStrings(
@@ -189,7 +189,7 @@ func (s *SuiteDotGit) TestNewObject(c *C) {
189189
c.Assert(err, IsNil)
190190
defer os.RemoveAll(tmp)
191191

192-
fs := osfs.NewOS(tmp)
192+
fs := osfs.New(tmp)
193193
dir := New(fs)
194194
w, err := dir.NewObject()
195195
c.Assert(err, IsNil)

storage/filesystem/internal/dotgit/writers_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func (s *SuiteDotGit) TestNewObjectPack(c *C) {
2424

2525
defer os.RemoveAll(dir)
2626

27-
fs := osfs.NewOS(dir)
27+
fs := osfs.New(dir)
2828
dot := New(fs)
2929

3030
w, err := dot.NewObjectPack()

utils/binary/read_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"testing"
77

88
. "gopkg.in/check.v1"
9-
"gopkg.in/src-d/go-git.v3/core"
9+
"gopkg.in/src-d/go-git.v4/core"
1010
)
1111

1212
func Test(t *testing.T) { TestingT(t) }

0 commit comments

Comments
 (0)