diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2016-09-11 20:35:06 +0200 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2016-09-11 20:35:06 +0200 |
commit | 58fe211f1b0e4863b425542d2fad15803276fd66 (patch) | |
tree | c200b6317b7b1c77c312faa411ab39e6e4468967 /storage/filesystem/object_test.go | |
parent | 6f1d1e00a7c615209cf6b25e314d033bda3b5d09 (diff) | |
download | go-git-58fe211f1b0e4863b425542d2fad15803276fd66.tar.gz |
format: packfile fix ReadObjectAt without decode
Diffstat (limited to 'storage/filesystem/object_test.go')
-rw-r--r-- | storage/filesystem/object_test.go | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/storage/filesystem/object_test.go b/storage/filesystem/object_test.go index 14c77e4..07fa646 100644 --- a/storage/filesystem/object_test.go +++ b/storage/filesystem/object_test.go @@ -17,7 +17,7 @@ func (s *FsSuite) SetUpSuite(c *C) { } func (s *FsSuite) TestGetFromObjectFile(c *C) { - fs := fixtures.ByTag(".git").ByTag("unpacked").DotGit() + fs := fixtures.ByTag(".git").ByTag("unpacked").One().DotGit() o, err := newObjectStorage(dotgit.New(fs)) c.Assert(err, IsNil) @@ -28,18 +28,20 @@ func (s *FsSuite) TestGetFromObjectFile(c *C) { } func (s *FsSuite) TestGetFromPackfile(c *C) { - fs := fixtures.Basic().ByTag(".git").DotGit() - o, err := newObjectStorage(dotgit.New(fs)) - c.Assert(err, IsNil) + fixtures.Basic().ByTag(".git").Test(c, func(f *fixtures.Fixture) { + fs := f.DotGit() + o, err := newObjectStorage(dotgit.New(fs)) + c.Assert(err, IsNil) - expected := core.NewHash("6ecf0ef2c2dffb796033e5a02219af86ec6584e5") - obj, err := o.Get(core.AnyObject, expected) - c.Assert(err, IsNil) - c.Assert(obj.Hash(), Equals, expected) + expected := core.NewHash("6ecf0ef2c2dffb796033e5a02219af86ec6584e5") + obj, err := o.Get(core.AnyObject, expected) + c.Assert(err, IsNil) + c.Assert(obj.Hash(), Equals, expected) + }) } func (s *FsSuite) TestGetFromPackfileMultiplePackfiles(c *C) { - fs := fixtures.ByTag(".git").ByTag("multi-packfile").DotGit() + fs := fixtures.ByTag(".git").ByTag("multi-packfile").One().DotGit() o, err := newObjectStorage(dotgit.New(fs)) c.Assert(err, IsNil) |