From c9a5b0a6b24130d607c1b00f82fd1d0f5cecd842 Mon Sep 17 00:00:00 2001 From: Benoit Gagnon Date: Wed, 24 Jul 2019 22:16:00 -0400 Subject: [PATCH] Pass -n flag to git clone There's an explicit git checkout command issued moments later, so there's no need to create a working copy during the clone. --- pkg/git.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/git.go b/pkg/git.go index d2cd6f3..60fc997 100644 --- a/pkg/git.go +++ b/pkg/git.go @@ -36,7 +36,7 @@ func NewGitPackage(source *spec.GitSource) Interface { } func (p *GitPackage) Install(ctx context.Context, dir, version string) (lockVersion string, err error) { - cmd := exec.CommandContext(ctx, "git", "clone", p.Source.Remote, dir) + cmd := exec.CommandContext(ctx, "git", "clone", "-n", p.Source.Remote, dir) cmd.Stdin = os.Stdin cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr