Open abh opened 5 years ago
In https://godoc.org/gopkg.in/src-d/go-git.v4#example-Clone there's an example of cloning a repository and using memfs as the worktree.
Is this possible with an existing bare git repository on disk, too?
Alternatively, if I have a bare repository opened already (*git.Repository), can I set/reset the Worktree to a fresh memfs?
Yes, this is possible. I use this in go-gitdir to load files stored as a part of a server (so I don't want worktrees around)
https://github.com/belak/go-gitdir/blob/master/internal/git/repository.go
In https://godoc.org/gopkg.in/src-d/go-git.v4#example-Clone there's an example of cloning a repository and using memfs as the worktree.
Is this possible with an existing bare git repository on disk, too?
Alternatively, if I have a bare repository opened already (*git.Repository), can I set/reset the Worktree to a fresh memfs?