From 88f88ea4cf5d44065edda8b06c2267a9dccea16e Mon Sep 17 00:00:00 2001 From: "Santiago M. Mola" Date: Wed, 31 May 2017 09:02:01 +0200 Subject: storage/filesystem: call initialization explicitely, fixes #408 filesystem.Storage was initializing the gitdir (creating objects and refs) on NewStorage. But this should be done only on init and clone operations, not on open. Now there is a new interface storer.Initializer that storers can implement if they need any initialization step before init or clone. filesystem.Storage is one of such implementations. git.Init and git.Clone now call to the storer Init() method if it does implement it. Otherwise, it just ignores initialization. --- storage/filesystem/internal/dotgit/dotgit.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'storage/filesystem/internal/dotgit/dotgit.go') diff --git a/storage/filesystem/internal/dotgit/dotgit.go b/storage/filesystem/internal/dotgit/dotgit.go index f9f4d79..1af64ab 100644 --- a/storage/filesystem/internal/dotgit/dotgit.go +++ b/storage/filesystem/internal/dotgit/dotgit.go @@ -231,7 +231,7 @@ func (d *DotGit) Objects() ([]plumbing.Hash, error) { return objects, nil } -// Object return a fs.File poiting the object file, if exists +// Object return a fs.File pointing the object file, if exists func (d *DotGit) Object(h plumbing.Hash) (billy.File, error) { hash := h.String() file := d.fs.Join(objectsPath, hash[0:2], hash[2:40]) -- cgit