From f578b09846bd5f26da89037c36c427bd2267caab Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Sat, 22 Jun 2019 12:17:46 -0300 Subject: [PATCH] fix: remove single branch option Signed-off-by: Carlos Alexandro Becker --- pkg/buildcontext/git.go | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/pkg/buildcontext/git.go b/pkg/buildcontext/git.go index 1909e8377..9908350b1 100644 --- a/pkg/buildcontext/git.go +++ b/pkg/buildcontext/git.go @@ -34,16 +34,13 @@ type Git struct { func (g *Git) UnpackTarFromBuildContext() (string, error) { directory := constants.BuildContextDir parts := strings.Split(g.context, "#") - url := "https://" + parts[0] - branch := "master" - if len(parts) > 1 { - branch = parts[1] + options := git.CloneOptions{ + URL: "https://" + parts[0], + Progress: os.Stdout, } - _, err := git.PlainClone(directory, false, &git.CloneOptions{ - URL: url, - Progress: os.Stdout, - ReferenceName: plumbing.ReferenceName(branch), - SingleBranch: true, - }) + if len(parts) > 1 { + options.ReferenceName = plumbing.ReferenceName(parts[1]) + } + _, err := git.PlainClone(directory, false, &options) return directory, err }