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

Function pointersToFetchForRefs

commands/command_fetch.go:212–240  ·  view source on GitHub ↗
(refs []string)

Source from the content-addressed store, hash-verified

210}
211
212func pointersToFetchForRefs(refs []string) ([]*lfs.WrappedPointer, error) {
213 // This could be a long process so use the chan version & report progress
214 logger := tasklog.NewLogger(OutputWriter,
215 tasklog.ForceProgress(cfg.ForceProgress()),
216 )
217 task := logger.Simple()
218 defer task.Complete()
219
220 // use temp gitscanner to collect pointers
221 var pointers []*lfs.WrappedPointer
222 var multiErr error
223 var numObjs int64
224 tempgitscanner := lfs.NewGitScanner(cfg, func(p *lfs.WrappedPointer, err error) {
225 if err != nil {
226 multiErr = errors.Join(multiErr, err)
227 return
228 }
229
230 numObjs++
231 task.Log(tr.Tr.GetN("%d object found", "%d objects found", int(numObjs), numObjs))
232 pointers = append(pointers, p)
233 })
234
235 if err := tempgitscanner.ScanRefs(refs, nil, nil); err != nil {
236 return nil, err
237 }
238
239 return pointers, multiErr
240}
241
242func fetchRefs(refs []string, watcher *fetchWatcher) bool {
243 pointers, err := pointersToFetchForRefs(refs)

Callers 1

fetchRefsFunction · 0.85

Calls 9

SimpleMethod · 0.95
ScanRefsMethod · 0.95
NewLoggerFunction · 0.92
ForceProgressFunction · 0.92
NewGitScannerFunction · 0.92
JoinFunction · 0.92
ForceProgressMethod · 0.80
LogMethod · 0.80
CompleteMethod · 0.45

Tested by

no test coverage detected