MCPcopy Index your code
hub / github.com/go-task/task / getLockForRepo

Method getLockForRepo

taskfile/node_git.go:36–45  ·  view source on GitHub ↗
(cacheKey string)

Source from the content-addressed store, hash-verified

34}
35
36func (c *gitRepoCache) getLockForRepo(cacheKey string) *sync.Mutex {
37 c.mu.Lock()
38 defer c.mu.Unlock()
39
40 if _, exists := c.locks[cacheKey]; !exists {
41 c.locks[cacheKey] = &sync.Mutex{}
42 }
43
44 return c.locks[cacheKey]
45}
46
47var globalGitRepoCache = &gitRepoCache{
48 locks: make(map[string]*sync.Mutex),

Callers 1

getOrCloneRepoMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected