aboutsummaryrefslogtreecommitdiffstats
path: root/storage/filesystem/dotgit/repository_filesystem_test.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2021-05-02 23:40:08 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2021-05-02 23:40:08 +0200
commit01df7536992af375a54bbedf45369a475953e372 (patch)
tree8435050f4388f15b3a85d135a3f7d11b1ff61540 /storage/filesystem/dotgit/repository_filesystem_test.go
parent67af9d7223b0cc643025d958c592291f7475ac75 (diff)
downloadgo-git-01df7536992af375a54bbedf45369a475953e372.tar.gz
*: use go-billy instead of os calls
Diffstat (limited to 'storage/filesystem/dotgit/repository_filesystem_test.go')
-rw-r--r--storage/filesystem/dotgit/repository_filesystem_test.go15
1 files changed, 3 insertions, 12 deletions
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)