diff --git a/lfsapi/client.go b/lfsapi/client.go index dbc4b154..e7eb083b 100644 --- a/lfsapi/client.go +++ b/lfsapi/client.go @@ -304,6 +304,10 @@ func newRequestForRetry(req *http.Request, location string) (*http.Request, erro // lfsapi.Client.traceRequest(). newReq.Body = req.Body newReq.ContentLength = req.ContentLength + + // Copy the request's context.Context, if any. + newReq = newReq.WithContext(req.Context()) + return newReq, nil }