From 1eb39394cdf09b26eb2f5c98225fb2912980e61f Mon Sep 17 00:00:00 2001 From: Sergio Arbeo Date: Mon, 19 Dec 2016 10:42:14 +0100 Subject: 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 --- storage/filesystem/internal/dotgit/writers.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'storage/filesystem/internal/dotgit/writers.go') 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 -- cgit