diff --git a/pkg/git/gogit/checkout.go b/pkg/git/gogit/checkout.go index 0e1e7509f..46a74ae09 100644 --- a/pkg/git/gogit/checkout.go +++ b/pkg/git/gogit/checkout.go @@ -126,13 +126,12 @@ func (c *CheckoutCommit) Checkout(ctx context.Context, path, url string, auth *g URL: url, Auth: auth.AuthMethod, RemoteName: git.DefaultOrigin, - ReferenceName: plumbing.NewBranchReferenceName(c.branch), - SingleBranch: true, - NoCheckout: false, + NoCheckout: true, RecurseSubmodules: 0, Progress: nil, Tags: extgogit.NoTags, }) + if err != nil { return nil, "", fmt.Errorf("unable to clone '%s', error: %w", url, err) } diff --git a/pkg/git/libgit2/checkout.go b/pkg/git/libgit2/checkout.go index f5254016f..7d66ded48 100644 --- a/pkg/git/libgit2/checkout.go +++ b/pkg/git/libgit2/checkout.go @@ -129,7 +129,6 @@ func (c *CheckoutCommit) Checkout(ctx context.Context, path, url string, auth *g CertificateCheckCallback: auth.CertCallback, }, }, - CheckoutBranch: c.branch, }) if err != nil { return nil, "", fmt.Errorf("unable to clone '%s', error: %w", url, err)