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

Function NewClient

locking/locks.go:63–73  ·  view source on GitHub ↗

NewClient creates a new locking client with the given configuration You must call the returned object's `Close` method when you are finished with it

(remote string, lfsClient *lfsapi.Client, cfg *config.Configuration)

Source from the content-addressed store, hash-verified

61// You must call the returned object's `Close` method when you are finished with
62// it
63func NewClient(remote string, lfsClient *lfsapi.Client, cfg *config.Configuration) (*Client, error) {
64 return &Client{
65 Remote: remote,
66 client: newGenericLockClient(lfsClient),
67 cache: &nilLockCacher{},
68 cfg: cfg,
69 ModifyIgnoredFiles: lfsClient.GitEnv().Bool("lfs.lockignoredfiles", false),
70 LocalWorkingDir: cfg.LocalWorkingDir(),
71 LocalGitDir: cfg.LocalGitDir(),
72 }, nil
73}
74
75func (c *Client) SetupFileCache(path string) error {
76 stat, err := os.Stat(path)

Callers 4

newLockClientFunction · 0.92
TestRemoteLocksWithCacheFunction · 0.70
TestRefreshCacheFunction · 0.70

Calls 5

newGenericLockClientFunction · 0.85
LocalWorkingDirMethod · 0.80
LocalGitDirMethod · 0.80
BoolMethod · 0.65
GitEnvMethod · 0.65

Tested by 3

TestRemoteLocksWithCacheFunction · 0.56
TestRefreshCacheFunction · 0.56