(logf func(string, ...any), options options.Options)
| 348 | } |
| 349 | |
| 350 | func 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 | |
| 377 | type progressWriter struct { |
| 378 | io.WriteCloser |
no test coverage detected