mirror of
https://github.com/grdl/git-get.git
synced 2026-02-04 23:14:43 +00:00
Remove gogit and major refactoring (#2)
* Fix typo in readme * Reimplement all git methods without go-git * Rename repo pkg to git, add gitconfig methods * Improve tests for configuration reading * Rename package file to io and move RepoFinder there * Refactor printers - Remove smart printer - Decouple printers from git repos with interfaces - Update printer functions - Remove unnecessary flags - Add better remote URL detection * Update readme and go.mod * Add author to git commit in tests Otherwise tests will fail in CI. * Install git before running tests and don't use cgo * Add better error message, revert installing git * Ensure commit message is in quotes * Set up git config before running tests
This commit is contained in:
committed by
GitHub
parent
2ef739ea49
commit
8c132cdafa
10
pkg/get.go
10
pkg/get.go
@@ -2,7 +2,7 @@ package pkg
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"git-get/pkg/repo"
|
||||
"git-get/pkg/git"
|
||||
"path"
|
||||
)
|
||||
|
||||
@@ -37,13 +37,13 @@ func cloneSingleRepo(c *GetCfg) error {
|
||||
return err
|
||||
}
|
||||
|
||||
cloneOpts := &repo.CloneOpts{
|
||||
cloneOpts := &git.CloneOpts{
|
||||
URL: url,
|
||||
Path: path.Join(c.Root, URLToPath(url)),
|
||||
Branch: c.Branch,
|
||||
}
|
||||
|
||||
_, err = repo.Clone(cloneOpts)
|
||||
_, err = git.Clone(cloneOpts)
|
||||
|
||||
return err
|
||||
}
|
||||
@@ -60,14 +60,14 @@ func cloneDumpFile(c *GetCfg) error {
|
||||
return err
|
||||
}
|
||||
|
||||
cloneOpts := &repo.CloneOpts{
|
||||
cloneOpts := &git.CloneOpts{
|
||||
URL: url,
|
||||
Path: path.Join(c.Root, URLToPath(url)),
|
||||
Branch: line.branch,
|
||||
IgnoreExisting: true,
|
||||
}
|
||||
|
||||
_, err = repo.Clone(cloneOpts)
|
||||
_, err = git.Clone(cloneOpts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user