aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common_test.go8
-rw-r--r--config/config.go2
-rw-r--r--examples/common_test.go4
-rw-r--r--examples/storage/aerospike/storage.go356
-rw-r--r--examples/storage/main.go70
-rw-r--r--fixtures/fixtures.go4
-rw-r--r--plumbing/format/packfile/decoder_test.go6
-rw-r--r--plumbing/transport/server/loader.go4
-rw-r--r--remote_test.go3
-rw-r--r--repository.go2
-rw-r--r--repository_test.go18
-rw-r--r--storage/filesystem/config_test.go9
-rw-r--r--storage/filesystem/internal/dotgit/dotgit_test.go3
-rw-r--r--storage/filesystem/internal/dotgit/writers_test.go3
-rw-r--r--storage/filesystem/storage_test.go5
-rw-r--r--worktree_test.go14
16 files changed, 39 insertions, 472 deletions
diff --git a/common_test.go b/common_test.go
index 9c20a9a..c874c38 100644
--- a/common_test.go
+++ b/common_test.go
@@ -14,8 +14,8 @@ import (
"gopkg.in/src-d/go-git.v4/storage/memory"
. "gopkg.in/check.v1"
- memoryfs "srcd.works/go-billy.v1/memory"
- "srcd.works/go-billy.v1/os"
+ "srcd.works/go-billy.v1/memfs"
+ "srcd.works/go-billy.v1/osfs"
)
func Test(t *testing.T) { TestingT(t) }
@@ -49,7 +49,7 @@ func (s *BaseSuite) buildBasicRepository(c *C) {
}
func (s *BaseSuite) NewRepository(f *fixtures.Fixture) *Repository {
- fs := os.New(f.DotGit().Base())
+ fs := osfs.New(f.DotGit().Base())
st, err := filesystem.NewStorage(fs)
if err != nil {
panic(err)
@@ -86,7 +86,7 @@ func (s *BaseSuite) NewRepositoryFromPackfile(f *fixtures.Fixture) *Repository {
storer.SetReference(plumbing.NewHashReference(plumbing.HEAD, f.Head))
- r, err := Open(storer, memoryfs.New())
+ r, err := Open(storer, memfs.New())
if err != nil {
panic(err)
}
diff --git a/config/config.go b/config/config.go
index bf0cea2..cef96bb 100644
--- a/config/config.go
+++ b/config/config.go
@@ -1,4 +1,4 @@
-// Package config storage is the implementation of git config for go-git
+// Package config contains the abstraction of config files
package config
import (
diff --git a/examples/common_test.go b/examples/common_test.go
index 0baf2f1..357d400 100644
--- a/examples/common_test.go
+++ b/examples/common_test.go
@@ -24,9 +24,7 @@ var args = map[string][]string{
"push": []string{setEmptyRemote(cloneRepository(defaultURL, tempFolder()))},
}
-var ignored = map[string]bool{
- "storage": true,
-}
+var ignored = map[string]bool{}
var tempFolders = []string{}
diff --git a/examples/storage/aerospike/storage.go b/examples/storage/aerospike/storage.go
deleted file mode 100644
index 712c329..0000000
--- a/examples/storage/aerospike/storage.go
+++ /dev/null
@@ -1,356 +0,0 @@
-package aerospike
-
-import (
- "encoding/json"
- "fmt"
- "io"
- "io/ioutil"
-
- "gopkg.in/src-d/go-git.v4/config"
- "gopkg.in/src-d/go-git.v4/plumbing"
- "gopkg.in/src-d/go-git.v4/plumbing/format/index"
- "gopkg.in/src-d/go-git.v4/plumbing/storer"
-
- driver "github.com/aerospike/aerospike-client-go"
-)
-
-const (
- urlField = "url"
- referencesSet = "reference"
- configSet = "config"
-)
-
-type Storage struct {
- client *driver.Client
- ns string
- url string
-}
-
-func NewStorage(client *driver.Client, ns, url string) (*Storage, error) {
- if err := createIndexes(client, ns); err != nil {
- return nil, err
- }
-
- return &Storage{client: client, ns: ns, url: url}, nil
-}
-
-func (s *Storage) NewEncodedObject() plumbing.EncodedObject {
- return &plumbing.MemoryObject{}
-}
-
-func (s *Storage) SetEncodedObject(obj plumbing.EncodedObject) (plumbing.Hash, error) {
- key, err := s.buildKey(obj.Hash(), obj.Type())
- if err != nil {
- return obj.Hash(), err
- }
-
- r, err := obj.Reader()
- if err != nil {
- return obj.Hash(), err
- }
-
- c, err := ioutil.ReadAll(r)
- if err != nil {
- return obj.Hash(), err
- }
-
- bins := driver.BinMap{
- urlField: s.url,
- "hash": obj.Hash().String(),
- "type": obj.Type().String(),
- "blob": c,
- }
-
- err = s.client.Put(nil, key, bins)
- return obj.Hash(), err
-}
-
-func (s *Storage) EncodedObject(t plumbing.ObjectType, h plumbing.Hash) (plumbing.EncodedObject, error) {
- key, err := s.buildKey(h, t)
- if err != nil {
- return nil, err
- }
-
- rec, err := s.client.Get(nil, key)
- if err != nil {
- return nil, err
- }
-
- if rec == nil {
- return nil, plumbing.ErrObjectNotFound
- }
-
- return objectFromRecord(rec, t)
-}
-
-func (s *Storage) IterEncodedObjects(t plumbing.ObjectType) (storer.EncodedObjectIter, error) {
- stmnt := driver.NewStatement(s.ns, t.String())
- err := stmnt.Addfilter(driver.NewEqualFilter(urlField, s.url))
-
- rs, err := s.client.Query(nil, stmnt)
- if err != nil {
- return nil, err
- }
-
- return &EncodedObjectIter{t, rs.Records}, nil
-}
-
-func (s *Storage) buildKey(h plumbing.Hash, t plumbing.ObjectType) (*driver.Key, error) {
- return driver.NewKey(s.ns, t.String(), fmt.Sprintf("%s|%s", s.url, h.String()))
-}
-
-type EncodedObjectIter struct {
- t plumbing.ObjectType
- ch chan *driver.Record
-}
-
-func (i *EncodedObjectIter) Next() (plumbing.EncodedObject, error) {
- r := <-i.ch
- if r == nil {
- return nil, io.EOF
- }
-
- return objectFromRecord(r, i.t)
-}
-
-func (i *EncodedObjectIter) ForEach(cb func(obj plumbing.EncodedObject) error) error {
- for {
- obj, err := i.Next()
- if err != nil {
- if err == io.EOF {
- return nil
- }
-
- return err
- }
-
- if err := cb(obj); err != nil {
- if err == storer.ErrStop {
- return nil
- }
-
- return err
- }
- }
-}
-
-func (i *EncodedObjectIter) Close() {}
-
-func objectFromRecord(r *driver.Record, t plumbing.ObjectType) (plumbing.EncodedObject, error) {
- content := r.Bins["blob"].([]byte)
-
- o := &plumbing.MemoryObject{}
- o.SetType(t)
- o.SetSize(int64(len(content)))
-
- _, err := o.Write(content)
- if err != nil {
- return nil, err
- }
-
- return o, nil
-}
-
-func (s *Storage) SetReference(ref *plumbing.Reference) error {
- key, err := s.buildReferenceKey(ref.Name())
- if err != nil {
- return err
- }
-
- raw := ref.Strings()
- bins := driver.BinMap{
- urlField: s.url,
- "name": raw[0],
- "target": raw[1],
- }
-
- return s.client.Put(nil, key, bins)
-}
-
-func (s *Storage) Reference(n plumbing.ReferenceName) (*plumbing.Reference, error) {
- key, err := s.buildReferenceKey(n)
- if err != nil {
- return nil, err
- }
-
- rec, err := s.client.Get(nil, key)
- if err != nil {
- return nil, err
- }
-
- return plumbing.NewReferenceFromStrings(
- rec.Bins["name"].(string),
- rec.Bins["target"].(string),
- ), nil
-}
-
-func (s *Storage) buildReferenceKey(n plumbing.ReferenceName) (*driver.Key, error) {
- return driver.NewKey(s.ns, referencesSet, fmt.Sprintf("%s|%s", s.url, n))
-}
-
-func (s *Storage) IterReferences() (storer.ReferenceIter, error) {
- stmnt := driver.NewStatement(s.ns, referencesSet)
- err := stmnt.Addfilter(driver.NewEqualFilter(urlField, s.url))
- if err != nil {
- return nil, err
- }
-
- rs, err := s.client.Query(nil, stmnt)
- if err != nil {
- return nil, err
- }
-
- var refs []*plumbing.Reference
- for r := range rs.Records {
- refs = append(refs, plumbing.NewReferenceFromStrings(
- r.Bins["name"].(string),
- r.Bins["target"].(string),
- ))
- }
-
- return storer.NewReferenceSliceIter(refs), nil
-}
-
-func (s *Storage) Config() (*config.Config, error) {
- key, err := s.buildConfigKey()
- if err != nil {
- return nil, err
- }
-
- rec, err := s.client.Get(nil, key)
- if err != nil {
- return nil, err
- }
-
- c := &config.Config{}
- return c, json.Unmarshal(rec.Bins["blob"].([]byte), c)
-}
-
-func (s *Storage) SetConfig(r *config.Config) error {
- key, err := s.buildConfigKey()
- if err != nil {
- return err
- }
-
- json, err := json.Marshal(r)
- if err != nil {
- return err
- }
-
- bins := driver.BinMap{
- urlField: s.url,
- "blob": json,
- }
-
- return s.client.Put(nil, key, bins)
-}
-
-func (s *Storage) buildConfigKey() (*driver.Key, error) {
- return driver.NewKey(s.ns, configSet, fmt.Sprintf("%s|config", s.url))
-}
-
-func (s *Storage) Index() (*index.Index, error) {
- key, err := s.buildIndexKey()
- if err != nil {
- return nil, err
- }
-
- rec, err := s.client.Get(nil, key)
- if err != nil {
- return nil, err
- }
-
- idx := &index.Index{}
- return idx, json.Unmarshal(rec.Bins["blob"].([]byte), idx)
-}
-
-func (s *Storage) SetIndex(idx *index.Index) error {
- key, err := s.buildIndexKey()
- if err != nil {
- return err
- }
-
- json, err := json.Marshal(idx)
- if err != nil {
- return err
- }
-
- bins := driver.BinMap{
- urlField: s.url,
- "blob": json,
- }
-
- return s.client.Put(nil, key, bins)
-}
-
-func (s *Storage) buildIndexKey() (*driver.Key, error) {
- return driver.NewKey(s.ns, configSet, fmt.Sprintf("%s|index", s.url))
-}
-
-func (s *Storage) Shallow() ([]plumbing.Hash, error) {
- key, err := s.buildShallowKey()
- if err != nil {
- return nil, err
- }
-
- rec, err := s.client.Get(nil, key)
- if err != nil {
- return nil, err
- }
-
- var h []plumbing.Hash
- return h, json.Unmarshal(rec.Bins["blob"].([]byte), h)
-}
-
-func (s *Storage) SetShallow(hash []plumbing.Hash) error {
- key, err := s.buildShallowKey()
- if err != nil {
- return err
- }
-
- json, err := json.Marshal(hash)
- if err != nil {
- return err
- }
-
- bins := driver.BinMap{
- urlField: s.url,
- "blob": json,
- }
-
- return s.client.Put(nil, key, bins)
-}
-
-func (s *Storage) buildShallowKey() (*driver.Key, error) {
- return driver.NewKey(s.ns, configSet, fmt.Sprintf("%s|shallow", s.url))
-}
-
-func createIndexes(c *driver.Client, ns string) error {
- for _, set := range [...]string{
- referencesSet,
- configSet,
- plumbing.BlobObject.String(),
- plumbing.TagObject.String(),
- plumbing.TreeObject.String(),
- plumbing.CommitObject.String(),
- } {
- if err := createIndex(c, ns, set); err != nil {
- return err
- }
- }
-
- return nil
-}
-
-func createIndex(c *driver.Client, ns, set string) error {
- task, err := c.CreateIndex(nil, ns, set, set, urlField, driver.STRING)
- if err != nil {
- if err.Error() == "Index already exists" {
- return nil
- }
-
- return err
- }
-
- return <-task.OnComplete()
-}
diff --git a/examples/storage/main.go b/examples/storage/main.go
deleted file mode 100644
index 05752a1..0000000
--- a/examples/storage/main.go
+++ /dev/null
@@ -1,70 +0,0 @@
-package main
-
-import (
- "fmt"
- "os"
- "strings"
-
- "gopkg.in/src-d/go-git.v4"
- . "gopkg.in/src-d/go-git.v4/examples"
- "gopkg.in/src-d/go-git.v4/examples/storage/aerospike"
-
- driver "github.com/aerospike/aerospike-client-go"
-)
-
-func main() {
- CheckArgs("<clone|log>", "<url>")
- action := os.Args[1]
- url := os.Args[2]
-
- // Aerospike client to be used by the custom storage
- client, err := driver.NewClient("127.0.0.1", 3000)
- CheckIfError(err)
-
- // New instance of the custom aerospike storage, all the objects,
- // references and configuration is saved to aerospike
- s, err := aerospike.NewStorage(client, "test", url)
- CheckIfError(err)
-
- switch action {
- case "clone":
- clone(s, url)
- case "log":
- log(s)
- default:
- panic("unknown option")
- }
-}
-
-func clone(s git.Storer, url string) {
- // Clone the given repository, all the objects, references and
- // configuration sush as remotes, are save into the Aerospike database
- // using the custom storer
- Info("git clone %s", url)
-
- _, err := git.Clone(s, nil, &git.CloneOptions{URL: url})
- CheckIfError(err)
-}
-
-func log(s git.Storer) {
- // We open the repository using as storer the custom implementation
- r, err := git.Open(s, nil)
- CheckIfError(err)
-
- // Prints the history of the repository starting in the current HEAD, the
- // objects are retrieved from Aerospike database.
- Info("git log --oneline")
-
- ref, err := r.Head()
- CheckIfError(err)
- commit, err := r.Commit(ref.Hash())
- CheckIfError(err)
- commits, err := commit.History()
- CheckIfError(err)
-
- for _, c := range commits {
- hash := c.Hash.String()
- line := strings.Split(c.Message, "\n")
- fmt.Println(hash[:7], line[0])
- }
-}
diff --git a/fixtures/fixtures.go b/fixtures/fixtures.go
index b3fc717..d467caf 100644
--- a/fixtures/fixtures.go
+++ b/fixtures/fixtures.go
@@ -8,12 +8,12 @@ import (
"os"
"path/filepath"
- "gopkg.in/check.v1"
"gopkg.in/src-d/go-git.v4/plumbing"
"github.com/alcortesm/tgz"
+ "gopkg.in/check.v1"
"srcd.works/go-billy.v1"
- osfs "srcd.works/go-billy.v1/os"
+ "srcd.works/go-billy.v1/osfs"
)
var RootFolder = ""
diff --git a/plumbing/format/packfile/decoder_test.go b/plumbing/format/packfile/decoder_test.go
index 0ab5bc8..8cb5087 100644
--- a/plumbing/format/packfile/decoder_test.go
+++ b/plumbing/format/packfile/decoder_test.go
@@ -3,6 +3,8 @@ package packfile_test
import (
"io"
+ "srcd.works/go-billy.v1/memfs"
+
"gopkg.in/src-d/go-git.v4/fixtures"
"gopkg.in/src-d/go-git.v4/plumbing"
"gopkg.in/src-d/go-git.v4/plumbing/format/idxfile"
@@ -11,8 +13,6 @@ import (
"gopkg.in/src-d/go-git.v4/storage/filesystem"
"gopkg.in/src-d/go-git.v4/storage/memory"
- fs "srcd.works/go-billy.v1/memory"
-
. "gopkg.in/check.v1"
)
@@ -164,7 +164,7 @@ func (s *ReaderSuite) TestDecodeNoSeekableWithoutTxStorer(c *C) {
scanner := packfile.NewScanner(reader)
var storage storer.EncodedObjectStorer
- storage, _ = filesystem.NewStorage(fs.New())
+ storage, _ = filesystem.NewStorage(memfs.New())
_, isTxStorer := storage.(storer.Transactioner)
c.Assert(isTxStorer, Equals, false)
diff --git a/plumbing/transport/server/loader.go b/plumbing/transport/server/loader.go
index 55bcf1d..7b5770b 100644
--- a/plumbing/transport/server/loader.go
+++ b/plumbing/transport/server/loader.go
@@ -6,11 +6,11 @@ import (
"gopkg.in/src-d/go-git.v4/storage/filesystem"
"srcd.works/go-billy.v1"
- "srcd.works/go-billy.v1/os"
+ "srcd.works/go-billy.v1/osfs"
)
// DefaultLoader is a filesystem loader ignoring host and resolving paths to /.
-var DefaultLoader = NewFilesystemLoader(os.New("/"))
+var DefaultLoader = NewFilesystemLoader(osfs.New("/"))
// Loader loads repository's storer.Storer based on an optional host and a path.
type Loader interface {
diff --git a/remote_test.go b/remote_test.go
index 0fb1dc0..3d01672 100644
--- a/remote_test.go
+++ b/remote_test.go
@@ -14,9 +14,8 @@ import (
"gopkg.in/src-d/go-git.v4/storage/filesystem"
"gopkg.in/src-d/go-git.v4/storage/memory"
- osfs "srcd.works/go-billy.v1/os"
-
. "gopkg.in/check.v1"
+ "srcd.works/go-billy.v1/osfs"
)
type RemoteSuite struct {
diff --git a/repository.go b/repository.go
index 56fbc3c..9fc00f5 100644
--- a/repository.go
+++ b/repository.go
@@ -12,7 +12,7 @@ import (
"gopkg.in/src-d/go-git.v4/storage/filesystem"
"srcd.works/go-billy.v1"
- osfs "srcd.works/go-billy.v1/os"
+ "srcd.works/go-billy.v1/osfs"
)
var (
diff --git a/repository_test.go b/repository_test.go
index 1c43c6e..c46011b 100644
--- a/repository_test.go
+++ b/repository_test.go
@@ -17,7 +17,7 @@ import (
"gopkg.in/src-d/go-git.v4/storage/memory"
. "gopkg.in/check.v1"
- memoryfs "srcd.works/go-billy.v1/memory"
+ "srcd.works/go-billy.v1/memfs"
)
type RepositorySuite struct {
@@ -27,7 +27,7 @@ type RepositorySuite struct {
var _ = Suite(&RepositorySuite{})
func (s *RepositorySuite) TestInit(c *C) {
- r, err := Init(memory.NewStorage(), memoryfs.New())
+ r, err := Init(memory.NewStorage(), memfs.New())
c.Assert(err, IsNil)
c.Assert(r, NotNil)
@@ -62,11 +62,11 @@ func (s *RepositorySuite) TestInitAlreadyExists(c *C) {
func (s *RepositorySuite) TestOpen(c *C) {
st := memory.NewStorage()
- r, err := Init(st, memoryfs.New())
+ r, err := Init(st, memfs.New())
c.Assert(err, IsNil)
c.Assert(r, NotNil)
- r, err = Open(st, memoryfs.New())
+ r, err = Open(st, memfs.New())
c.Assert(err, IsNil)
c.Assert(r, NotNil)
}
@@ -86,7 +86,7 @@ func (s *RepositorySuite) TestOpenBare(c *C) {
func (s *RepositorySuite) TestOpenMissingWorktree(c *C) {
st := memory.NewStorage()
- r, err := Init(st, memoryfs.New())
+ r, err := Init(st, memfs.New())
c.Assert(err, IsNil)
c.Assert(r, NotNil)
@@ -270,7 +270,7 @@ func (s *RepositorySuite) TestFetch(c *C) {
}
func (s *RepositorySuite) TestCloneDeep(c *C) {
- fs := memoryfs.New()
+ fs := memfs.New()
r, _ := Init(memory.NewStorage(), fs)
head, err := r.Head()
@@ -419,7 +419,7 @@ func (s *RepositorySuite) TestCloneDetachedHEAD(c *C) {
}
func (s *RepositorySuite) TestPullCheckout(c *C) {
- fs := memoryfs.New()
+ fs := memfs.New()
r, _ := Init(memory.NewStorage(), fs)
r.CreateRemote(&config.RemoteConfig{
Name: DefaultRemoteName,
@@ -435,7 +435,7 @@ func (s *RepositorySuite) TestPullCheckout(c *C) {
}
func (s *RepositorySuite) TestCloneWithProgress(c *C) {
- fs := memoryfs.New()
+ fs := memfs.New()
buf := bytes.NewBuffer(nil)
_, err := Clone(memory.NewStorage(), fs, &CloneOptions{
@@ -766,7 +766,7 @@ func (s *RepositorySuite) TestObjectNotFound(c *C) {
}
func (s *RepositorySuite) TestWorktree(c *C) {
- def := memoryfs.New()
+ def := memfs.New()
r, _ := Init(memory.NewStorage(), def)
w, err := r.Worktree()
c.Assert(err, IsNil)
diff --git a/storage/filesystem/config_test.go b/storage/filesystem/config_test.go
index 6fbf826..17ecec8 100644
--- a/storage/filesystem/config_test.go
+++ b/storage/filesystem/config_test.go
@@ -2,14 +2,13 @@ package filesystem
import (
"io/ioutil"
- stdos "os"
+ "os"
"gopkg.in/src-d/go-git.v4/fixtures"
"gopkg.in/src-d/go-git.v4/storage/filesystem/internal/dotgit"
- "srcd.works/go-billy.v1/os"
-
. "gopkg.in/check.v1"
+ "srcd.works/go-billy.v1/osfs"
)
type ConfigSuite struct {
@@ -25,7 +24,7 @@ func (s *ConfigSuite) SetUpTest(c *C) {
tmp, err := ioutil.TempDir("", "go-git-filestystem-config")
c.Assert(err, IsNil)
- s.dir = dotgit.New(os.New(tmp))
+ s.dir = dotgit.New(osfs.New(tmp))
s.path = tmp
}
@@ -46,5 +45,5 @@ func (s *ConfigSuite) TestRemotes(c *C) {
}
func (s *ConfigSuite) TearDownTest(c *C) {
- defer stdos.RemoveAll(s.path)
+ defer os.RemoveAll(s.path)
}
diff --git a/storage/filesystem/internal/dotgit/dotgit_test.go b/storage/filesystem/internal/dotgit/dotgit_test.go
index bff90af..eb11478 100644
--- a/storage/filesystem/internal/dotgit/dotgit_test.go
+++ b/storage/filesystem/internal/dotgit/dotgit_test.go
@@ -10,9 +10,8 @@ import (
"gopkg.in/src-d/go-git.v4/fixtures"
"gopkg.in/src-d/go-git.v4/plumbing"
- osfs "srcd.works/go-billy.v1/os"
-
. "gopkg.in/check.v1"
+ "srcd.works/go-billy.v1/osfs"
)
func Test(t *testing.T) { TestingT(t) }
diff --git a/storage/filesystem/internal/dotgit/writers_test.go b/storage/filesystem/internal/dotgit/writers_test.go
index c546a3a..65ef5dc 100644
--- a/storage/filesystem/internal/dotgit/writers_test.go
+++ b/storage/filesystem/internal/dotgit/writers_test.go
@@ -10,9 +10,8 @@ import (
"gopkg.in/src-d/go-git.v4/fixtures"
- osfs "srcd.works/go-billy.v1/os"
-
. "gopkg.in/check.v1"
+ "srcd.works/go-billy.v1/osfs"
)
func (s *SuiteDotGit) TestNewObjectPack(c *C) {
diff --git a/storage/filesystem/storage_test.go b/storage/filesystem/storage_test.go
index 0e8ffb3..c48fdd2 100644
--- a/storage/filesystem/storage_test.go
+++ b/storage/filesystem/storage_test.go
@@ -5,9 +5,8 @@ import (
"gopkg.in/src-d/go-git.v4/storage/test"
- "srcd.works/go-billy.v1/os"
-
. "gopkg.in/check.v1"
+ "srcd.works/go-billy.v1/osfs"
)
func Test(t *testing.T) { TestingT(t) }
@@ -19,7 +18,7 @@ type StorageSuite struct {
var _ = Suite(&StorageSuite{})
func (s *StorageSuite) SetUpTest(c *C) {
- storage, err := NewStorage(os.New(c.MkDir()))
+ storage, err := NewStorage(osfs.New(c.MkDir()))
c.Assert(err, IsNil)
s.BaseStorageSuite = test.NewBaseStorageSuite(storage)
diff --git a/worktree_test.go b/worktree_test.go
index 55c0078..e4e7c7f 100644
--- a/worktree_test.go
+++ b/worktree_test.go
@@ -8,8 +8,8 @@ import (
"gopkg.in/src-d/go-git.v4/plumbing/object"
. "gopkg.in/check.v1"
- "srcd.works/go-billy.v1/memory"
- osfs "srcd.works/go-billy.v1/os"
+ "srcd.works/go-billy.v1/memfs"
+ "srcd.works/go-billy.v1/osfs"
)
type WorktreeSuite struct {
@@ -28,7 +28,7 @@ func (s *WorktreeSuite) TestCheckout(c *C) {
h, err := s.Repository.Head()
c.Assert(err, IsNil)
- fs := memory.New()
+ fs := memfs.New()
w := &Worktree{
r: s.Repository,
fs: fs,
@@ -53,11 +53,11 @@ func (s *WorktreeSuite) TestCheckout(c *C) {
c.Assert(idx.Entries, HasLen, 9)
}
-func (s *WorktreeSuite) TestCheckoutIndexMemory(c *C) {
+func (s *WorktreeSuite) TestCheckoutIndexmemfs(c *C) {
h, err := s.Repository.Head()
c.Assert(err, IsNil)
- fs := memory.New()
+ fs := memfs.New()
w := &Worktree{
r: s.Repository,
fs: fs,
@@ -75,7 +75,7 @@ func (s *WorktreeSuite) TestCheckoutIndexMemory(c *C) {
c.Assert(idx.Entries[0].ModifiedAt.IsZero(), Equals, false)
c.Assert(idx.Entries[0].Size, Equals, uint32(189))
- // ctime, dev, inode, uid and gid are not supported on memory fs
+ // ctime, dev, inode, uid and gid are not supported on memfs fs
c.Assert(idx.Entries[0].CreatedAt.IsZero(), Equals, true)
c.Assert(idx.Entries[0].Dev, Equals, uint32(0))
c.Assert(idx.Entries[0].Inode, Equals, uint32(0))
@@ -120,7 +120,7 @@ func (s *WorktreeSuite) TestStatus(c *C) {
h, err := s.Repository.Head()
c.Assert(err, IsNil)
- fs := memory.New()
+ fs := memfs.New()
w := &Worktree{
r: s.Repository,
fs: fs,