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

Method Add

locking/cache.go:29–36  ·  view source on GitHub ↗

Cache a successful lock for faster local lookup later

(l Lock)

Source from the content-addressed store, hash-verified

27
28// Cache a successful lock for faster local lookup later
29func (c *LockCache) Add(l Lock) error {
30 // Store reference in both directions
31 // Path -> Lock
32 c.kv.Set(l.Path, &l)
33 // EncodedId -> Lock (encoded so we can easily identify)
34 c.kv.Set(c.encodeIdKey(l.Id), &l)
35 return nil
36}
37
38// Remove a cached lock by path because it's been relinquished
39func (c *LockCache) RemoveByPath(filePath string) error {

Callers 1

TestLockCacheFunction · 0.95

Calls 2

encodeIdKeyMethod · 0.95
SetMethod · 0.65

Tested by 1

TestLockCacheFunction · 0.76