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

Method verifyUpload

tq/ssh.go:286–309  ·  view source on GitHub ↗
(t *Transfer, workerNum int)

Source from the content-addressed store, hash-verified

284}
285
286func (a *SSHAdapter) verifyUpload(t *Transfer, workerNum int) error {
287 args := a.argumentsForTransfer(t, "upload")
288 conn, err := a.transfer.Connection(workerNum)
289 if err != nil {
290 return err
291 }
292 conn.Lock()
293 defer conn.Unlock()
294 err = conn.SendMessage(fmt.Sprintf("verify-object %s", t.Oid), args)
295 if err != nil {
296 return err
297 }
298 status, _, lines, err := conn.ReadStatusWithLines()
299 if err != nil {
300 return err
301 }
302 if status < 200 || status > 299 {
303 if len(lines) > 0 {
304 return errors.New(tr.Tr.Get("got status %d when verifying upload OID %s: %s", status, t.Oid, lines[0]))
305 }
306 return errors.New(tr.Tr.Get("got status %d when verifying upload OID %s", status, t.Oid))
307 }
308 return nil
309}
310
311func (a *SSHAdapter) doUpload(t *Transfer, workerNum int, f *os.File, cb ProgressCallback) (int, []string, []string, error) {
312 args := a.argumentsForTransfer(t, "upload")

Callers 1

uploadMethod · 0.95

Calls 8

argumentsForTransferMethod · 0.95
NewFunction · 0.92
ConnectionMethod · 0.80
SendMessageMethod · 0.80
ReadStatusWithLinesMethod · 0.80
LockMethod · 0.65
UnlockMethod · 0.65
GetMethod · 0.65

Tested by

no test coverage detected