From 01df7536992af375a54bbedf45369a475953e372 Mon Sep 17 00:00:00 2001 From: Máximo Cuadros Date: Sun, 2 May 2021 23:40:08 +0200 Subject: *: use go-billy instead of os calls --- storage/filesystem/dotgit/repository_filesystem_test.go | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'storage/filesystem/dotgit/repository_filesystem_test.go') diff --git a/storage/filesystem/dotgit/repository_filesystem_test.go b/storage/filesystem/dotgit/repository_filesystem_test.go index 880ec0d..022bde7 100644 --- a/storage/filesystem/dotgit/repository_filesystem_test.go +++ b/storage/filesystem/dotgit/repository_filesystem_test.go @@ -1,25 +1,16 @@ package dotgit import ( - "io/ioutil" - "log" "os" - "github.com/go-git/go-billy/v5/osfs" - . "gopkg.in/check.v1" ) func (s *SuiteDotGit) TestRepositoryFilesystem(c *C) { - dir, err := ioutil.TempDir("", "repository_filesystem") - if err != nil { - log.Fatal(err) - } - defer os.RemoveAll(dir) - - fs := osfs.New(dir) + fs, clean := s.TemporalFilesystem() + defer clean() - err = fs.MkdirAll("dotGit", 0777) + err := fs.MkdirAll("dotGit", 0777) c.Assert(err, IsNil) dotGitFs, err := fs.Chroot("dotGit") c.Assert(err, IsNil) -- cgit