mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-21 06:43:05 -08:00
feat: add --depth option to git clone (#46)
This commit is contained in:
committed by
Teppei Fukuda
parent
76ee7291d6
commit
68f326d9e1
@@ -92,7 +92,7 @@ func clone(url, repoPath string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func cloneByOSCommand(url, repoPath string) error {
|
func cloneByOSCommand(url, repoPath string) error {
|
||||||
commandAndArgs := []string{"clone", url, repoPath}
|
commandAndArgs := []string{"clone", "--depth=1", url, repoPath}
|
||||||
_, err := utils.Exec("git", commandAndArgs)
|
_, err := utils.Exec("git", commandAndArgs)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return xerrors.Errorf("error in git clone: %w", err)
|
return xerrors.Errorf("error in git clone: %w", err)
|
||||||
|
|||||||
Reference in New Issue
Block a user