From e86eda1bf3d9f13a48ebe1c7f926166ef0f2e16b Mon Sep 17 00:00:00 2001 From: Jonathan Innis Date: Wed, 24 Mar 2021 22:00:10 -0700 Subject: [PATCH] No checkout the clone before moving to the commit hash Signed-off-by: Jonathan Innis --- pkg/git/gogit/checkout.go | 5 ++--- pkg/git/libgit2/checkout.go | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) 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)