diff options
author | Sergio Arbeo <serabe@gmail.com> | 2016-12-19 10:42:14 +0100 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2016-12-19 10:42:14 +0100 |
commit | 1eb39394cdf09b26eb2f5c98225fb2912980e61f (patch) | |
tree | 25e7b370498733aba66688c5d53c29fcef6aa21c /storage/filesystem/internal/dotgit/writers.go | |
parent | c9353b2bd7c1cbdf8f78dad6deac64ed2f2ed9eb (diff) | |
download | go-git-1eb39394cdf09b26eb2f5c98225fb2912980e61f.tar.gz |
Extract billy (#173)
* Extract billy
Billy is a new library directly extracted from go-git. It abstract
several storages systems in a filesystem interface.
More in github.com/src-d/billy
* Fix grouping in imports block
* Update billy to v1
* Re-remove fs_implementation example
Diffstat (limited to 'storage/filesystem/internal/dotgit/writers.go')
-rw-r--r-- | storage/filesystem/internal/dotgit/writers.go | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/storage/filesystem/internal/dotgit/writers.go b/storage/filesystem/internal/dotgit/writers.go index 8e22a39..1cd893d 100644 --- a/storage/filesystem/internal/dotgit/writers.go +++ b/storage/filesystem/internal/dotgit/writers.go @@ -9,7 +9,8 @@ import ( "gopkg.in/src-d/go-git.v4/plumbing/format/idxfile" "gopkg.in/src-d/go-git.v4/plumbing/format/objfile" "gopkg.in/src-d/go-git.v4/plumbing/format/packfile" - "gopkg.in/src-d/go-git.v4/utils/fs" + + "srcd.works/go-billy.v1" ) // PackWriter is a io.Writer that generates the packfile index simultaneously, @@ -21,15 +22,15 @@ import ( type PackWriter struct { Notify func(h plumbing.Hash, i idxfile.Idxfile) - fs fs.Filesystem - fr, fw fs.File + fs billy.Filesystem + fr, fw billy.File synced *syncedReader checksum plumbing.Hash index idxfile.Idxfile result chan error } -func newPackWrite(fs fs.Filesystem) (*PackWriter, error) { +func newPackWrite(fs billy.Filesystem) (*PackWriter, error) { fw, err := fs.TempFile(fs.Join(objectsPath, packPath), "tmp_pack_") if err != nil { return nil, err @@ -248,11 +249,11 @@ func (s *syncedReader) Close() error { type ObjectWriter struct { objfile.Writer - fs fs.Filesystem - f fs.File + fs billy.Filesystem + f billy.File } -func newObjectWriter(fs fs.Filesystem) (*ObjectWriter, error) { +func newObjectWriter(fs billy.Filesystem) (*ObjectWriter, error) { f, err := fs.TempFile(fs.Join(objectsPath, packPath), "tmp_obj_") if err != nil { return nil, err |