Update go git (#209)

This commit is contained in:
Jonny Stoten
2024-10-22 15:31:55 +01:00
committed by GitHub
parent ca97a23d07
commit b4a9283ec3
3 changed files with 33 additions and 51 deletions

View File

@@ -63,7 +63,7 @@ func Clone(ctx context.Context, gitRepo string, gitCommit string, targetDir stri
return fmt.Errorf("failed to get worktree: %w", err)
}
err = wt.Checkout(&git.CheckoutOptions{
Branch: plumbing.ReferenceName(localBranch),
Hash: plumbing.NewHash(gitCommit),
})
if err != nil {
return fmt.Errorf("failed to checkout: %w", err)