From aeb073cbf7245c753c8e51e0de220c29ce83ea62 Mon Sep 17 00:00:00 2001 From: Raj Das Date: Fri, 23 Sep 2022 16:36:02 +0530 Subject: [PATCH] Adding depth=1 in the git clone options (#3776) Signed-off-by: Raj Babu Das Signed-off-by: Raj Babu Das --- litmus-portal/graphql-server/pkg/myhub/ops/gitops.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/litmus-portal/graphql-server/pkg/myhub/ops/gitops.go b/litmus-portal/graphql-server/pkg/myhub/ops/gitops.go index 06bbbaf02fa..7865c686768 100644 --- a/litmus-portal/graphql-server/pkg/myhub/ops/gitops.go +++ b/litmus-portal/graphql-server/pkg/myhub/ops/gitops.go @@ -90,12 +90,12 @@ func (c MyHubConfig) getChaosChartRepo() (string, error) { ClonePath := GetClonePath(c) os.RemoveAll(ClonePath) _, err := git.PlainClone(ClonePath, false, &git.CloneOptions{ - URL: c.RepositoryURL, Progress: os.Stdout, + URL: c.RepositoryURL, Progress: os.Stdout, Depth: 1, ReferenceName: plumbing.NewBranchReferenceName(c.Branch), }) if err != nil { _, err = git.PlainClone(ClonePath, false, &git.CloneOptions{ - URL: c.RepositoryURL, Progress: os.Stdout, + URL: c.RepositoryURL, Progress: os.Stdout, Depth: 1, ReferenceName: plumbing.NewTagReferenceName(c.Branch), }) return c.Branch, err @@ -117,12 +117,14 @@ func (c MyHubConfig) getPrivateChaosChartRepo() (string, error) { Auth: auth, URL: c.RepositoryURL, Progress: os.Stdout, + Depth: 1, ReferenceName: plumbing.NewBranchReferenceName(c.Branch), }) if err != nil { _, err = git.PlainClone(ClonePath, false, &git.CloneOptions{ Auth: auth, URL: c.RepositoryURL, + Depth: 1, Progress: os.Stdout, ReferenceName: plumbing.NewTagReferenceName(c.Branch), })