aboutsummaryrefslogtreecommitdiffstats
path: root/storage/filesystem/object_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/object_test.go
parent67af9d7223b0cc643025d958c592291f7475ac75 (diff)
downloadgo-git-01df7536992af375a54bbedf45369a475953e372.tar.gz
*: use go-billy instead of os calls
Diffstat (limited to 'storage/filesystem/object_test.go')
-rw-r--r--storage/filesystem/object_test.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/storage/filesystem/object_test.go b/storage/filesystem/object_test.go
index 036420f..22f5b0c 100644
--- a/storage/filesystem/object_test.go
+++ b/storage/filesystem/object_test.go
@@ -9,6 +9,8 @@ import (
"path/filepath"
"testing"
+ "github.com/go-git/go-billy/v5"
+ "github.com/go-git/go-billy/v5/osfs"
"github.com/go-git/go-git/v5/plumbing"
"github.com/go-git/go-git/v5/plumbing/cache"
"github.com/go-git/go-git/v5/storage/filesystem/dotgit"
@@ -226,14 +228,14 @@ func (s *FsSuite) TestPackfileIter(c *C) {
})
}
-func copyFile(c *C, dstDir, dstFilename string, srcFile *os.File) {
+func copyFile(c *C, dstDir, dstFilename string, srcFile billy.File) {
_, err := srcFile.Seek(0, 0)
c.Assert(err, IsNil)
- err = os.MkdirAll(dstDir, 0750|os.ModeDir)
+ err = osfs.Default.MkdirAll(dstDir, 0750|os.ModeDir)
c.Assert(err, IsNil)
- dst, err := os.OpenFile(filepath.Join(dstDir, dstFilename), os.O_CREATE|os.O_WRONLY, 0666)
+ dst, err := osfs.Default.OpenFile(filepath.Join(dstDir, dstFilename), os.O_CREATE|os.O_WRONLY, 0666)
c.Assert(err, IsNil)
defer dst.Close()