MCPcopy Create free account
hub / github.com/cloudflare/artifact-fs / BuildTreeIndex

Method BuildTreeIndex

internal/gitstore/gitstore.go:264–294  ·  view source on GitHub ↗
(ctx context.Context, repo model.RepoConfig, headOID string)

Source from the content-addressed store, hash-verified

262 for _, p := range pools {
263 p.closeAll()
264 }
265}
266
267func (s *Store) SetBatchPoolSize(n int) {
268 if n <= 0 {
269 return
270 }
271 s.mu.Lock()
272 defer s.mu.Unlock()
273 if s.closed {
274 return
275 }
276 s.poolMaxSize = n
277 for _, p := range s.pools {
278 p.setMaxSize(n)
279 }
280}
281
282func (s *Store) CloneBlobless(ctx context.Context, cfg model.RepoConfig) error {
283 return s.cloneBlobless(ctx, cfg, nil)
284}
285
286func (s *Store) CloneBloblessNonInteractive(ctx context.Context, cfg model.RepoConfig) error {
287 return s.cloneBlobless(ctx, cfg, nonInteractiveGitEnv())
288}
289
290func (s *Store) cloneBlobless(ctx context.Context, cfg model.RepoConfig, extraEnv []string) error {
291 if _, err := os.Stat(cfg.GitDir); err == nil {
292 return nil
293 } else if !errors.Is(err, os.ErrNotExist) {
294 return err
295 }
296 parent := filepath.Dir(cfg.GitDir)
297 if err := os.MkdirAll(parent, 0o755); err != nil {

Callers

nothing calls this directly

Calls 5

batchResolveSizesMethod · 0.95
rootNodeFunction · 0.85
streamTreeRecordsFunction · 0.85
parseTreeRecordFunction · 0.85
addImplicitDirsFunction · 0.85

Tested by

no test coverage detected