go-git
go-git copied to clipboard
Mapping from a PlainClone to Clone
Hi,
I currently use a
repo, err := git.PlainClone(dir, isBare, options)
with great, success. Thanks! This uses the local OS filesystem, and I'd like to use one of the Fs interfaces instead. It seems you have your own named billy
. I'm using Afero. That's okay, because there's now a wrapper, so I can do:
billyFs := desfacer.New(myAferoFs)
The problem is actually how do I add a billyFs to a clone? I found this:
repo, err := git.Clone(s storage.Storer, billyFs, options)
But I have no idea how to get the storage.Storer
... I have a path
. So what's the equivalency of PlainClone
but using a billyfs?
Thanks!
I'm having same issue. I have tried something like this:
cache := cache.NewObjectLRUDefault()
billyfs := desfacer.NewPath(fs, path)
storer := filesystem.NewStorage(billyfs, cache)
_, err = git.Clone(storer, billyfs, &git.CloneOptions{
URL: repoURL,
})
But I'm always having repository already exists
error.