Shareable Git-powered notebooks
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

19 lines
394 B

package main
import (
git "github.com/go-git/go-git/v5"
)
func initializeRepository(worktree string, cloneurl string) (*git.Repository, error) {
if cloneurl == "" {
return git.PlainInit(worktree, false)
}
return git.PlainClone(worktree, false, &git.CloneOptions{
URL: cloneurl,
})
}
func loadRepository(worktree string) (*git.Repository, error) {
return git.PlainOpen(worktree)
}