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

Method SearchVerifiable

locking/ssh.go:226–262  ·  view source on GitHub ↗
(remote string, vreq *lockVerifiableRequest)

Source from the content-addressed store, hash-verified

224}
225
226func (c *sshLockClient) SearchVerifiable(remote string, vreq *lockVerifiableRequest) (*lockVerifiableList, int, error) {
227 args := make([]string, 0, 3)
228 if vreq.Ref != nil {
229 args = append(args, fmt.Sprintf("refname=%s", vreq.Ref.Name))
230 }
231 if len(vreq.Cursor) > 0 {
232 args = append(args, fmt.Sprintf("cursor=%s", vreq.Cursor))
233 }
234 if vreq.Limit > 0 {
235 args = append(args, fmt.Sprintf("limit=%d", vreq.Limit))
236 }
237 conn, err := c.connection()
238 if err != nil {
239 return nil, 0, err
240 }
241 conn.Lock()
242 defer conn.Unlock()
243 err = conn.SendMessage("list-lock", args)
244 if err != nil {
245 return nil, 0, err
246 }
247 status, args, lines, err := conn.ReadStatusWithLines()
248 if err != nil {
249 return nil, status, err
250 }
251 _, ours, theirs, nextCursor, message, err := c.parseListLockResponse(status, args, lines)
252 if err != nil {
253 return nil, status, err
254 }
255 list := &lockVerifiableList{
256 Ours: ours,
257 Theirs: theirs,
258 NextCursor: nextCursor,
259 Message: message,
260 }
261 return list, status, nil
262}

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected