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

Method IsFileLockedByCurrentCommitter

locking/locks.go:421–429  ·  view source on GitHub ↗

IsFileLockedByCurrentCommitter returns whether a file is locked by the current user, as cached locally

(path string)

Source from the content-addressed store, hash-verified

419// IsFileLockedByCurrentCommitter returns whether a file is locked by the
420// current user, as cached locally
421func (c *Client) IsFileLockedByCurrentCommitter(path string) bool {
422 filter := map[string]string{"path": path}
423 locks, err := c.searchLocalLocks(filter, 1)
424 if err != nil {
425 tracerx.Printf("Error searching cached locks: %s\nForcing remote search", err)
426 locks, _ = c.searchRemoteLocks(filter, 1)
427 }
428 return len(locks) > 0
429}
430
431func init() {
432 kv.RegisterTypeForStorage(&Lock{})

Callers 1

Calls 2

searchLocalLocksMethod · 0.95
searchRemoteLocksMethod · 0.95

Tested by

no test coverage detected