aboutsummaryrefslogtreecommitdiffstats
path: root/storage
diff options
context:
space:
mode:
Diffstat (limited to 'storage')
-rw-r--r--storage/filesystem/dotgit/dotgit_test.go9
-rw-r--r--storage/filesystem/object_test.go6
-rw-r--r--storage/transactional/config_test.go2
-rw-r--r--storage/transactional/reference.go4
4 files changed, 9 insertions, 12 deletions
diff --git a/storage/filesystem/dotgit/dotgit_test.go b/storage/filesystem/dotgit/dotgit_test.go
index 4c2ae94..a8f0eb7 100644
--- a/storage/filesystem/dotgit/dotgit_test.go
+++ b/storage/filesystem/dotgit/dotgit_test.go
@@ -3,6 +3,7 @@ package dotgit
import (
"bufio"
"encoding/hex"
+ "io"
"io/ioutil"
"os"
"path/filepath"
@@ -510,13 +511,13 @@ func (s *SuiteDotGit) TestObjectPackWithKeepDescriptors(c *C) {
c.Assert(filepath.Ext(pack.Name()), Equals, ".pack")
// Move to an specific offset
- pack.Seek(42, os.SEEK_SET)
+ pack.Seek(42, io.SeekStart)
pack2, err := dir.ObjectPack(plumbing.NewHash(f.PackfileHash))
c.Assert(err, IsNil)
// If the file is the same the offset should be the same
- offset, err := pack2.Seek(0, os.SEEK_CUR)
+ offset, err := pack2.Seek(0, io.SeekCurrent)
c.Assert(err, IsNil)
c.Assert(offset, Equals, int64(42))
@@ -527,7 +528,7 @@ func (s *SuiteDotGit) TestObjectPackWithKeepDescriptors(c *C) {
c.Assert(err, IsNil)
// If the file is opened again its offset should be 0
- offset, err = pack2.Seek(0, os.SEEK_CUR)
+ offset, err = pack2.Seek(0, io.SeekCurrent)
c.Assert(err, IsNil)
c.Assert(offset, Equals, int64(0))
@@ -653,7 +654,7 @@ func (s *SuiteDotGit) TestObject(c *C) {
fs.MkdirAll(incomingDirPath, os.FileMode(0755))
fs.Create(incomingFilePath)
- file, err = dir.Object(plumbing.NewHash(incomingHash))
+ _, err = dir.Object(plumbing.NewHash(incomingHash))
c.Assert(err, IsNil)
}
diff --git a/storage/filesystem/object_test.go b/storage/filesystem/object_test.go
index 59b40d3..19a7914 100644
--- a/storage/filesystem/object_test.go
+++ b/storage/filesystem/object_test.go
@@ -71,7 +71,7 @@ func (s *FsSuite) TestGetFromPackfileKeepDescriptors(c *C) {
pack1, err := dg.ObjectPack(packfiles[0])
c.Assert(err, IsNil)
- pack1.Seek(42, os.SEEK_SET)
+ pack1.Seek(42, io.SeekStart)
err = o.Close()
c.Assert(err, IsNil)
@@ -79,7 +79,7 @@ func (s *FsSuite) TestGetFromPackfileKeepDescriptors(c *C) {
pack2, err := dg.ObjectPack(packfiles[0])
c.Assert(err, IsNil)
- offset, err := pack2.Seek(0, os.SEEK_CUR)
+ offset, err := pack2.Seek(0, io.SeekCurrent)
c.Assert(err, IsNil)
c.Assert(offset, Equals, int64(0))
@@ -386,7 +386,7 @@ func (s *FsSuite) TestGetFromObjectFileSharedCache(c *C) {
c.Assert(err, IsNil)
c.Assert(obj.Hash(), Equals, expected)
- obj, err = o2.EncodedObject(plumbing.CommitObject, expected)
+ _, err = o2.EncodedObject(plumbing.CommitObject, expected)
c.Assert(err, Equals, plumbing.ErrObjectNotFound)
}
diff --git a/storage/transactional/config_test.go b/storage/transactional/config_test.go
index 1f3a572..34d7763 100644
--- a/storage/transactional/config_test.go
+++ b/storage/transactional/config_test.go
@@ -54,7 +54,7 @@ func (s *ConfigSuite) TestSetConfigTemporal(c *C) {
cfg, err = cs.Config()
c.Assert(err, IsNil)
- c.Assert(temporalCfg.Core.Worktree, Equals, "bar")
+ c.Assert(cfg.Core.Worktree, Equals, "bar")
}
func (s *ConfigSuite) TestCommit(c *C) {
diff --git a/storage/transactional/reference.go b/storage/transactional/reference.go
index 3b009e2..1c09307 100644
--- a/storage/transactional/reference.go
+++ b/storage/transactional/reference.go
@@ -15,9 +15,6 @@ type ReferenceStorage struct {
// commit is requested, the entries are added when RemoveReference is called
// and deleted if SetReference is called.
deleted map[plumbing.ReferenceName]struct{}
- // packRefs if true PackRefs is going to be called in the based storer when
- // commit is called.
- packRefs bool
}
// NewReferenceStorage returns a new ReferenceStorer based on a base storer and
@@ -108,7 +105,6 @@ func (r ReferenceStorage) CountLooseRefs() (int, error) {
// PackRefs honors the storer.ReferenceStorer interface.
func (r ReferenceStorage) PackRefs() error {
- r.packRefs = true
return nil
}