MCPcopy Create free account
hub / github.com/conforma/cli / clone

Function clone

internal/tracker/git.go:67–92  ·  view source on GitHub ↗
(ctx context.Context, repository string)

Source from the content-addressed store, hash-verified

65}
66
67func clone(ctx context.Context, repository string) (*git.Repository, error) {
68 fs := utils.FS(ctx)
69 tmpdir, err := afero.TempDir(fs, "", "ec-git")
70 if err != nil {
71 return nil, err
72 }
73
74 bfs, err := gba.New(fs, "", false).Chroot(tmpdir)
75 if err != nil {
76 return nil, err
77 }
78
79 s := filesystem.NewStorage(bfs, cache.NewObjectLRUDefault())
80
81 opts := git.CloneOptions{
82 URL: strings.TrimPrefix(repository, "git+"),
83 NoCheckout: true,
84 }
85
86 // set by acceptance tests
87 if os.Getenv("GIT_SSL_NO_VERIFY") == "true" {
88 opts.InsecureSkipTLS = true
89 }
90
91 return git.CloneContext(ctx, s, bfs, &opts)
92}
93
94func (g *gitTracker) GitResolve(ctx context.Context, repository, path string) (string, error) {
95 cfn := func() (*git.Repository, error) {

Callers 1

GitResolveMethod · 0.85

Calls 1

FSFunction · 0.92

Tested by

no test coverage detected