MCPcopy
hub / github.com/rilldata/rill / Clone

Function Clone

runtime/pkg/gitutil/gitcmdwrapper.go:27–41  ·  view source on GitHub ↗
(ctx context.Context, path, remote, checkoutBranch string, singleBranch, shallow bool)

Source from the content-addressed store, hash-verified

25}
26
27func Clone(ctx context.Context, path, remote, checkoutBranch string, singleBranch, shallow bool) error {
28 args := []string{"clone", remote, path}
29 if singleBranch {
30 args = append(args, "--single-branch")
31 }
32 if shallow {
33 args = append(args, "--depth", "1")
34 }
35 if checkoutBranch != "" {
36 args = append(args, "--branch", checkoutBranch)
37 }
38
39 _, err := Run(ctx, "", args...)
40 return err
41}
42
43// Checkout checks out a branch using the git command.
44// If create is true, it creates the branch (using -B) at the given startPoint.

Callers 2

pullInnerMethod · 0.92
setupRemoteAndCloneFunction · 0.70

Calls 1

RunFunction · 0.70

Tested by 1

setupRemoteAndCloneFunction · 0.56