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

Method Unlock

locking/ssh.go:169–192  ·  view source on GitHub ↗
(ref *git.Ref, remote, id string, force bool)

Source from the content-addressed store, hash-verified

167}
168
169func (c *sshLockClient) Unlock(ref *git.Ref, remote, id string, force bool) (*unlockResponse, int, error) {
170 args := make([]string, 0, 3)
171 if ref != nil {
172 args = append(args, fmt.Sprintf("refname=%s", ref.Name))
173 }
174 conn, err := c.connection()
175 if err != nil {
176 return nil, 0, err
177 }
178 conn.Lock()
179 defer conn.Unlock()
180 err = conn.SendMessage(fmt.Sprintf("unlock %s", id), args)
181 if err != nil {
182 return nil, 0, err
183 }
184 status, args, lines, err := conn.ReadStatusWithLines()
185 if err != nil {
186 return nil, status, err
187
188 }
189 var lock unlockResponse
190 lock.Lock, lock.Message, err = c.parseLockResponse(status, args, lines)
191 return &lock, status, err
192}
193
194func (c *sshLockClient) Search(remote string, searchReq *lockSearchRequest) (*lockList, int, error) {
195 values := searchReq.QueryValues()

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected