Init creates an empty git repository, based on the given Storer and worktree. The worktree Filesystem is optional, if nil a bare repository is created. If the given storer is not empty ErrRepositoryAlreadyExists is returned
(s storage.Storer, worktree billy.Filesystem)
| 86 | // The worktree Filesystem is optional, if nil a bare repository is created. If |
| 87 | // the given storer is not empty ErrRepositoryAlreadyExists is returned |
| 88 | func Init(s storage.Storer, worktree billy.Filesystem) (*Repository, error) { |
| 89 | options := InitOptions{ |
| 90 | DefaultBranch: plumbing.Master, |
| 91 | } |
| 92 | return InitWithOptions(s, worktree, options) |
| 93 | } |
| 94 | |
| 95 | func InitWithOptions(s storage.Storer, worktree billy.Filesystem, options InitOptions) (*Repository, error) { |
| 96 | if err := initStorer(s); err != nil { |
searching dependent graphs…