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

Method RemoveById

locking/cache.go:50–59  ·  view source on GitHub ↗

Remove a cached lock by id because it's been relinquished

(id string)

Source from the content-addressed store, hash-verified

48
49// Remove a cached lock by id because it's been relinquished
50func (c *LockCache) RemoveById(id string) error {
51 // Id as key is encoded
52 idkey := c.encodeIdKey(id)
53 ilock := c.kv.Get(idkey)
54 if lock, ok := ilock.(*Lock); ok && lock != nil {
55 c.kv.Remove(idkey)
56 c.kv.Remove(lock.Path)
57 }
58 return nil
59}
60
61// Get the list of cached locked files
62func (c *LockCache) Locks() []Lock {

Callers 1

TestLockCacheFunction · 0.95

Calls 3

encodeIdKeyMethod · 0.95
GetMethod · 0.65
RemoveMethod · 0.45

Tested by 1

TestLockCacheFunction · 0.76