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

Method Search

locking/ssh.go:194–224  ·  view source on GitHub ↗
(remote string, searchReq *lockSearchRequest)

Source from the content-addressed store, hash-verified

192}
193
194func (c *sshLockClient) Search(remote string, searchReq *lockSearchRequest) (*lockList, int, error) {
195 values := searchReq.QueryValues()
196 args := make([]string, 0, len(values))
197 for key, value := range values {
198 args = append(args, fmt.Sprintf("%s=%s", key, value))
199 }
200 conn, err := c.connection()
201 if err != nil {
202 return nil, 0, err
203 }
204 conn.Lock()
205 defer conn.Unlock()
206 err = conn.SendMessage("list-lock", args)
207 if err != nil {
208 return nil, 0, err
209 }
210 status, args, lines, err := conn.ReadStatusWithLines()
211 if err != nil {
212 return nil, status, err
213 }
214 locks, _, _, nextCursor, message, err := c.parseListLockResponse(status, args, lines)
215 if err != nil {
216 return nil, status, err
217 }
218 list := &lockList{
219 Locks: locks,
220 NextCursor: nextCursor,
221 Message: message,
222 }
223 return list, status, nil
224}
225
226func (c *sshLockClient) SearchVerifiable(remote string, vreq *lockVerifiableRequest) (*lockVerifiableList, int, error) {
227 args := make([]string, 0, 3)

Callers

nothing calls this directly

Calls 7

connectionMethod · 0.95
parseListLockResponseMethod · 0.95
QueryValuesMethod · 0.80
SendMessageMethod · 0.80
ReadStatusWithLinesMethod · 0.80
LockMethod · 0.65
UnlockMethod · 0.65

Tested by

no test coverage detected