fix: remove single branch option
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
This commit is contained in:
parent
c45e05f668
commit
f578b09846
|
|
@ -34,16 +34,13 @@ type Git struct {
|
||||||
func (g *Git) UnpackTarFromBuildContext() (string, error) {
|
func (g *Git) UnpackTarFromBuildContext() (string, error) {
|
||||||
directory := constants.BuildContextDir
|
directory := constants.BuildContextDir
|
||||||
parts := strings.Split(g.context, "#")
|
parts := strings.Split(g.context, "#")
|
||||||
url := "https://" + parts[0]
|
options := git.CloneOptions{
|
||||||
branch := "master"
|
URL: "https://" + parts[0],
|
||||||
if len(parts) > 1 {
|
Progress: os.Stdout,
|
||||||
branch = parts[1]
|
|
||||||
}
|
}
|
||||||
_, err := git.PlainClone(directory, false, &git.CloneOptions{
|
if len(parts) > 1 {
|
||||||
URL: url,
|
options.ReferenceName = plumbing.ReferenceName(parts[1])
|
||||||
Progress: os.Stdout,
|
}
|
||||||
ReferenceName: plumbing.ReferenceName(branch),
|
_, err := git.PlainClone(directory, false, &options)
|
||||||
SingleBranch: true,
|
|
||||||
})
|
|
||||||
return directory, err
|
return directory, err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue