feat(core): reimplement clone with go-git

This commit is contained in:
Micheal Wilkinson
2026-03-19 14:05:50 +00:00
parent d02d118b28
commit dbc77a1b34
2 changed files with 9 additions and 4 deletions

View File

@@ -10,6 +10,8 @@ import (
"path/filepath"
"sort"
"strings"
git "github.com/go-git/go-git/v5"
)
type App struct {
@@ -70,8 +72,12 @@ func (a *App) Clone(uri string, destination string) error {
return nil
}
if err := runGit(a.ReposDir, "clone", "-q", "--config", "push.default=upstream", "--recursive", uri, destination); err != nil {
return err
_, err := git.PlainClone(destinationPath, false, &git.CloneOptions{
URL: uri,
RecurseSubmodules: git.DefaultSubmoduleRecursionDepth,
})
if err != nil {
return fmt.Errorf("clone %q into %q failed: %w", uri, destinationPath, err)
}
return nil