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

Method getClient

locking/api.go:336–353  ·  view source on GitHub ↗
(remote, operation string)

Source from the content-addressed store, hash-verified

334}
335
336func (c *genericLockClient) getClient(remote, operation string) lockClient {
337 info := lockClientInfo{
338 remote: remote,
339 operation: operation,
340 }
341 if client := c.lclients[info]; client != nil {
342 return client
343 }
344 transfer := c.client.SSHTransfer(operation, remote)
345 var lclient lockClient
346 if transfer != nil {
347 lclient = &sshLockClient{transfer: transfer, Client: c.client}
348 } else {
349 lclient = &httpLockClient{Client: c.client}
350 }
351 c.lclients[info] = lclient
352 return lclient
353}
354
355func (c *genericLockClient) Lock(remote string, lockReq *lockRequest) (*lockResponse, int, error) {
356 return c.getClient(remote, "upload").Lock(remote, lockReq)

Callers 4

LockMethod · 0.95
UnlockMethod · 0.95
SearchMethod · 0.95
SearchVerifiableMethod · 0.95

Calls 1

SSHTransferMethod · 0.80

Tested by

no test coverage detected