MCPcopy
hub / github.com/git-lfs/git-lfs / scanAll

Function scanAll

commands/command_fetch.go:343–375  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

341}
342
343func scanAll() []*lfs.WrappedPointer {
344 // This could be a long process so use the chan version & report progress
345 logger := tasklog.NewLogger(OutputWriter,
346 tasklog.ForceProgress(cfg.ForceProgress()),
347 )
348 task := logger.Simple()
349 defer task.Complete()
350
351 // use temp gitscanner to collect pointers
352 var pointers []*lfs.WrappedPointer
353 var multiErr error
354 var numObjs int64
355 tempgitscanner := lfs.NewGitScanner(cfg, func(p *lfs.WrappedPointer, err error) {
356 if err != nil {
357 multiErr = errors.Join(multiErr, err)
358 return
359 }
360
361 numObjs++
362 task.Log(tr.Tr.GetN("%d object found", "%d objects found", int(numObjs), numObjs))
363 pointers = append(pointers, p)
364 })
365
366 if err := tempgitscanner.ScanAll(nil); err != nil {
367 Panic(err, tr.Tr.Get("Could not scan for Git LFS files"))
368 }
369
370 if multiErr != nil {
371 Panic(multiErr, tr.Tr.Get("Could not scan for Git LFS files"))
372 }
373
374 return pointers
375}
376
377// Fetch
378// Returns true if all completed with no errors, false if errors were written to stderr/log

Callers 1

fetchAllFunction · 0.85

Calls 11

SimpleMethod · 0.95
ScanAllMethod · 0.95
NewLoggerFunction · 0.92
ForceProgressFunction · 0.92
NewGitScannerFunction · 0.92
JoinFunction · 0.92
PanicFunction · 0.85
ForceProgressMethod · 0.80
LogMethod · 0.80
GetMethod · 0.65
CompleteMethod · 0.45

Tested by

no test coverage detected