Skip to content

Commit

Permalink
Adding depth=1 in the git clone options (#3776)
Browse files Browse the repository at this point in the history
Signed-off-by: Raj Babu Das <mail.rajdas@gmail.com>

Signed-off-by: Raj Babu Das <mail.rajdas@gmail.com>
  • Loading branch information
imrajdas committed Sep 23, 2022
1 parent 8d66f24 commit aeb073c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions litmus-portal/graphql-server/pkg/myhub/ops/gitops.go
Expand Up @@ -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
Expand All @@ -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),
})
Expand Down

0 comments on commit aeb073c

Please sign in to comment.