MCPcopy Create free account
hub / github.com/coder/envbuilder / CloneOptionsFromOptions

Function CloneOptionsFromOptions

git/git.go:350–375  ·  view source on GitHub ↗
(logf func(string, ...any), options options.Options)

Source from the content-addressed store, hash-verified

348}
349
350func CloneOptionsFromOptions(logf func(string, ...any), options options.Options) (CloneRepoOptions, error) {
351 caBundle, err := options.CABundle()
352 if err != nil {
353 return CloneRepoOptions{}, err
354 }
355
356 cloneOpts := CloneRepoOptions{
357 RepoURL: options.GitURL,
358 Path: options.WorkspaceFolder,
359 Storage: options.Filesystem,
360 Insecure: options.Insecure,
361 SingleBranch: options.GitCloneSingleBranch,
362 ThinPack: options.GitCloneThinPack,
363 Depth: int(options.GitCloneDepth),
364 CABundle: caBundle,
365 }
366
367 cloneOpts.RepoAuth = SetupRepoAuth(logf, &options)
368 if options.GitHTTPProxyURL != "" {
369 cloneOpts.ProxyOptions = transport.ProxyOptions{
370 URL: options.GitHTTPProxyURL,
371 }
372 }
373
374 return cloneOpts, nil
375}
376
377type progressWriter struct {
378 io.WriteCloser

Callers 2

runFunction · 0.92
RunCacheProbeFunction · 0.92

Calls 2

SetupRepoAuthFunction · 0.85
CABundleMethod · 0.80

Tested by

no test coverage detected