gosick #1

Merged
DelphicOkami merged 162 commits from gosick into main 2026-03-21 23:08:00 +00:00
2 changed files with 9 additions and 4 deletions
Showing only changes of commit dbc77a1b34 - Show all commits

View File

@@ -73,9 +73,8 @@ func (s *CloneSuite) createBareRemote(name string) string {
return remotePath
}
func (s *CloneSuite) TestClone_FileURLWorksWithoutGitInPath() {
func (s *CloneSuite) TestClone_FileURLWorks() {
remotePath := s.createBareRemote("castle")
s.T().Setenv("PATH", "")
err := s.app.Clone("file://"+remotePath, "parity-castle")
require.NoError(s.T(), err)

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