feat(core): reimplement clone with go-git
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user