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

Method SetupFileCache

locking/locks.go:75–94  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

73}
74
75func (c *Client) SetupFileCache(path string) error {
76 stat, err := os.Stat(path)
77 if err != nil {
78 return errors.Wrap(err, tr.Tr.Get("lock cache initialization"))
79 }
80
81 lockFile := path
82 if stat.IsDir() {
83 lockFile = filepath.Join(path, "lockcache.db")
84 }
85
86 cache, err := NewLockCache(lockFile)
87 if err != nil {
88 return errors.Wrap(err, tr.Tr.Get("lock cache initialization"))
89 }
90
91 c.cache = cache
92 c.cacheDir = filepath.Join(path, "cache")
93 return nil
94}
95
96// Close this client instance; must be called to dispose of resources
97func (c *Client) Close() error {

Callers 4

TestRemoteLocksWithCacheFunction · 0.95
TestRefreshCacheFunction · 0.95
newLockClientFunction · 0.95

Calls 3

WrapFunction · 0.92
NewLockCacheFunction · 0.85
GetMethod · 0.65

Tested by 3

TestRemoteLocksWithCacheFunction · 0.76
TestRefreshCacheFunction · 0.76