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

Function fetchPreviousVersions

commands/command_fetch.go:252–271  ·  view source on GitHub ↗

Fetch all previous versions of objects from since to ref (not including final state at ref) So this will fetch all the '-' sides of the diff from since to ref

(ref string, since time.Time, filter *filepathfilter.Filter, watcher *fetchWatcher)

Source from the content-addressed store, hash-verified

250// Fetch all previous versions of objects from since to ref (not including final state at ref)
251// So this will fetch all the '-' sides of the diff from since to ref
252func fetchPreviousVersions(ref string, since time.Time, filter *filepathfilter.Filter, watcher *fetchWatcher) bool {
253 var pointers []*lfs.WrappedPointer
254
255 tempgitscanner := lfs.NewGitScanner(cfg, func(p *lfs.WrappedPointer, err error) {
256 if err != nil {
257 Panic(err, tr.Tr.Get("Could not scan for Git LFS previous versions"))
258 return
259 }
260
261 pointers = append(pointers, p)
262 })
263
264 tempgitscanner.Filter = filter
265
266 if err := tempgitscanner.ScanPreviousVersions(ref, since, nil); err != nil {
267 ExitWithError(err)
268 }
269
270 return fetch(pointers, watcher)
271}
272
273// Fetch recent objects based on config
274func fetchRecent(fetchconf lfs.FetchPruneConfig, alreadyFetchedRefs []*git.Ref, filter *filepathfilter.Filter, watcher *fetchWatcher) bool {

Callers 1

fetchRecentFunction · 0.85

Calls 6

ScanPreviousVersionsMethod · 0.95
NewGitScannerFunction · 0.92
PanicFunction · 0.85
ExitWithErrorFunction · 0.85
fetchFunction · 0.85
GetMethod · 0.65

Tested by

no test coverage detected