MCPcopy Index your code
hub / github.com/git-lfs/git-lfs / remember

Method remember

tq/transfer_queue.go:396–414  ·  view source on GitHub ↗

remember remembers the *Transfer "t" if the *TransferQueue doesn't already know about a Transfer with the same OID. It returns if the value is new or not.

(t *objectTuple)

Source from the content-addressed store, hash-verified

394//
395// It returns if the value is new or not.
396func (q *TransferQueue) remember(t *objectTuple) objects {
397 q.Upgrade()
398
399 q.trMutex.Lock()
400 defer q.trMutex.Unlock()
401
402 if _, ok := q.transfers[t.Oid]; !ok {
403 q.wait.Add(1)
404 q.transfers[t.Oid] = &objects{
405 objects: []*objectTuple{t},
406 }
407
408 return *q.transfers[t.Oid]
409 }
410
411 q.transfers[t.Oid] = q.transfers[t.Oid].Append(t)
412
413 return *q.transfers[t.Oid]
414}
415
416// collectBatches collects batches in a loop, prioritizing failed items from the
417// previous before adding new items. The process works as follows:

Callers 1

AddMethod · 0.95

Calls 5

UpgradeMethod · 0.95
AppendMethod · 0.80
LockMethod · 0.65
UnlockMethod · 0.65
AddMethod · 0.65

Tested by

no test coverage detected