aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2017-07-19 22:04:18 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2017-07-19 22:04:18 +0200
commit6c75af73d8229be684703bf2210b7dc9587d2846 (patch)
tree37b0c554fda0fe9a9ce1b6dd6991855374b685db
parent8210c82bcd6ff7f7c66b8f5fc1be00307fe59c42 (diff)
downloadgo-git-6c75af73d8229be684703bf2210b7dc9587d2846.tar.gz
storage: dotgit, fix test not closing files
-rw-r--r--storage/filesystem/internal/dotgit/dotgit.go1
-rw-r--r--storage/filesystem/internal/dotgit/dotgit_test.go1
2 files changed, 2 insertions, 0 deletions
diff --git a/storage/filesystem/internal/dotgit/dotgit.go b/storage/filesystem/internal/dotgit/dotgit.go
index 7950af9..b672d4b 100644
--- a/storage/filesystem/internal/dotgit/dotgit.go
+++ b/storage/filesystem/internal/dotgit/dotgit.go
@@ -384,6 +384,7 @@ func (d *DotGit) rewritePackedRefsWithoutRef(name plumbing.ReferenceName) (err e
}
if err := f.Close(); err != nil {
+ ioutil.CheckClose(tmp, &err)
return err
}
diff --git a/storage/filesystem/internal/dotgit/dotgit_test.go b/storage/filesystem/internal/dotgit/dotgit_test.go
index d4cda0e..d935ec5 100644
--- a/storage/filesystem/internal/dotgit/dotgit_test.go
+++ b/storage/filesystem/internal/dotgit/dotgit_test.go
@@ -373,6 +373,7 @@ func (s *SuiteDotGit) TestObjectPackIdx(c *C) {
idx, err := dir.ObjectPackIdx(f.PackfileHash)
c.Assert(err, IsNil)
c.Assert(filepath.Ext(idx.Name()), Equals, ".idx")
+ c.Assert(idx.Close(), IsNil)
}
func (s *SuiteDotGit) TestObjectPackNotFound(c *C) {