From e0883ffb20fa19b9e06737b055266dafef16bafd Mon Sep 17 00:00:00 2001 From: Sunny Date: Sat, 28 May 2022 22:14:21 +0530 Subject: [PATCH] libgit2: Pass ctx to all the transport opts The context passed to Checkout() has a timeout. Pass it forward to the transport in the option for all the checkouts. Signed-off-by: Sunny --- pkg/git/libgit2/checkout.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/git/libgit2/checkout.go b/pkg/git/libgit2/checkout.go index 3f58e2397..261ee1ebb 100644 --- a/pkg/git/libgit2/checkout.go +++ b/pkg/git/libgit2/checkout.go @@ -238,6 +238,7 @@ func (c *CheckoutTag) Checkout(ctx context.Context, path, url string, opts *git. TargetURL: url, AuthOpts: opts, ProxyOptions: &git2go.ProxyOptions{Type: git2go.ProxyTypeAuto}, + Context: ctx, }) url = opts.TransportOptionsURL remoteCallBacks := managed.RemoteCallbacks() @@ -351,6 +352,7 @@ func (c *CheckoutCommit) Checkout(ctx context.Context, path, url string, opts *g TargetURL: url, AuthOpts: opts, ProxyOptions: &git2go.ProxyOptions{Type: git2go.ProxyTypeAuto}, + Context: ctx, }) url = opts.TransportOptionsURL remoteCallBacks = managed.RemoteCallbacks() @@ -395,6 +397,7 @@ func (c *CheckoutSemVer) Checkout(ctx context.Context, path, url string, opts *g TargetURL: url, AuthOpts: opts, ProxyOptions: &git2go.ProxyOptions{Type: git2go.ProxyTypeAuto}, + Context: ctx, }) url = opts.TransportOptionsURL remoteCallBacks = managed.RemoteCallbacks()