diff options
author | Santiago M. Mola <santi@mola.io> | 2016-12-14 23:12:44 +0100 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2016-12-14 23:12:44 +0100 |
commit | 0af572dd21c0aa79d13745b633ee24ba6c4d6cf1 (patch) | |
tree | 49e81e74e82d84fd88b2fc1e4b0dc7c7bfe9c40f /storage/filesystem/object_test.go | |
parent | df0f38af83f972f026d7e14150f3d37b95f13484 (diff) | |
download | go-git-0af572dd21c0aa79d13745b633ee24ba6c4d6cf1.tar.gz |
move plumbing from top level package to plumbing (#183)
* plumbing: rename Object -> EncodedObject.
* plumbing/storer: rename ObjectStorer -> EncodedObjectStorer.
* move difftree to plumbing/difftree.
* move diff -> utils/diff
* make Object/Tag/Blob/Tree/Commit/File depend on storer.
* Object and its implementations now depend only on
storer.EncodedObjectStorer, not git.Repository.
* Tests are decoupled accordingly.
* move Object/Commit/File/Tag/Tree to plumbing/object.
* move Object/Commit/File/Tag/Tree to plumbing/object.
* move checkClose to utils/ioutil.
* move RevListObjects to plumbing/revlist.Objects.
* move DiffTree to plumbing/difftree package.
* rename files with plural nouns to singular
* plumbing/object: add GetBlob/GetCommit/GetTag/GetTree.
Diffstat (limited to 'storage/filesystem/object_test.go')
-rw-r--r-- | storage/filesystem/object_test.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/storage/filesystem/object_test.go b/storage/filesystem/object_test.go index f839420..a3a5e68 100644 --- a/storage/filesystem/object_test.go +++ b/storage/filesystem/object_test.go @@ -20,7 +20,7 @@ func (s *FsSuite) TestGetFromObjectFile(c *C) { c.Assert(err, IsNil) expected := plumbing.NewHash("f3dfe29d268303fc6e1bbce268605fc99573406e") - obj, err := o.Object(plumbing.AnyObject, expected) + obj, err := o.EncodedObject(plumbing.AnyObject, expected) c.Assert(err, IsNil) c.Assert(obj.Hash(), Equals, expected) } @@ -32,7 +32,7 @@ func (s *FsSuite) TestGetFromPackfile(c *C) { c.Assert(err, IsNil) expected := plumbing.NewHash("6ecf0ef2c2dffb796033e5a02219af86ec6584e5") - obj, err := o.Object(plumbing.AnyObject, expected) + obj, err := o.EncodedObject(plumbing.AnyObject, expected) c.Assert(err, IsNil) c.Assert(obj.Hash(), Equals, expected) }) @@ -60,11 +60,11 @@ func (s *FsSuite) TestIter(c *C) { o, err := newObjectStorage(dotgit.New(fs)) c.Assert(err, IsNil) - iter, err := o.IterObjects(plumbing.AnyObject) + iter, err := o.IterEncodedObjects(plumbing.AnyObject) c.Assert(err, IsNil) var count int32 - err = iter.ForEach(func(o plumbing.Object) error { + err = iter.ForEach(func(o plumbing.EncodedObject) error { count++ return nil }) @@ -80,10 +80,10 @@ func (s *FsSuite) TestIterWithType(c *C) { o, err := newObjectStorage(dotgit.New(fs)) c.Assert(err, IsNil) - iter, err := o.IterObjects(plumbing.CommitObject) + iter, err := o.IterEncodedObjects(plumbing.CommitObject) c.Assert(err, IsNil) - err = iter.ForEach(func(o plumbing.Object) error { + err = iter.ForEach(func(o plumbing.EncodedObject) error { c.Assert(o.Type(), Equals, plumbing.CommitObject) return nil }) |