From 666c031821c501f185b736fa0ff354eec6f77d84 Mon Sep 17 00:00:00 2001 From: andres-portainer <91705312+andres-portainer@users.noreply.github.com> Date: Thu, 10 Oct 2024 18:49:50 -0300 Subject: [PATCH] fix(git): optimize the git cloning process in terms of space BE-11286 (#20) --- api/git/git.go | 1 + api/git/git_test.go | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/git/git.go b/api/git/git.go index 63161f7fa..6c2835815 100644 --- a/api/git/git.go +++ b/api/git/git.go @@ -34,6 +34,7 @@ func (c *gitClient) download(ctx context.Context, dst string, opt cloneOption) e Depth: opt.depth, InsecureSkipTLS: opt.tlsSkipVerify, Auth: getAuth(opt.username, opt.password), + Tags: git.NoTags, } if opt.referenceName != "" { diff --git a/api/git/git_test.go b/api/git/git_test.go index 0bce90d56..81efa2688 100644 --- a/api/git/git_test.go +++ b/api/git/git_test.go @@ -24,8 +24,7 @@ func setup(t *testing.T) string { t.Fatal(errors.Wrap(err, "failed to open an archive")) } - err = archive.ExtractTarGz(file, dir) - if err != nil { + if err := archive.ExtractTarGz(file, dir); err != nil { t.Fatal(errors.Wrapf(err, "failed to extract file from the archive to a folder %s", dir)) }