MCPcopy
hub / github.com/go-git/go-git / CloneContext

Function CloneContext

repository.go:238–247  ·  view source on GitHub ↗

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,
)

Source from the content-addressed store, hash-verified

236// operation is complete, an error is returned. The context only affects the
237// transport operations.
238func 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

Callers 2

TestCloneContextMethod · 0.85
CloneFunction · 0.85

Calls 2

InitFunction · 0.85
cloneMethod · 0.80

Tested by 1

TestCloneContextMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…