CloneContext a repository into the given Storer and worktree Filesystem with the given options, if worktree is nil a bare repository is created. If the given storer is not empty ErrRepositoryAlreadyExists is returned. The provided Context must be non-nil. If the context expires before the operation
( ctx context.Context, s storage.Storer, worktree billy.Filesystem, o *CloneOptions, )
| 236 | // operation is complete, an error is returned. The context only affects the |
| 237 | // transport operations. |
| 238 | func CloneContext( |
| 239 | ctx context.Context, s storage.Storer, worktree billy.Filesystem, o *CloneOptions, |
| 240 | ) (*Repository, error) { |
| 241 | r, err := Init(s, worktree) |
| 242 | if err != nil { |
| 243 | return nil, err |
| 244 | } |
| 245 | |
| 246 | return r, r.clone(ctx, o) |
| 247 | } |
| 248 | |
| 249 | // PlainInit create an empty git repository at the given path. isBare defines |
| 250 | // if the repository will have worktree (non-bare) or not (bare), if the path |
searching dependent graphs…