2018-06-11 13:13:19 +00:00
|
|
|
package stacks
|
|
|
|
|
|
|
|
type cloneRepositoryParameters struct {
|
|
|
|
url string
|
2018-07-24 14:11:35 +00:00
|
|
|
referenceName string
|
2018-06-11 13:13:19 +00:00
|
|
|
path string
|
|
|
|
authentication bool
|
|
|
|
username string
|
|
|
|
password string
|
|
|
|
}
|
|
|
|
|
|
|
|
func (handler *Handler) cloneGitRepository(parameters *cloneRepositoryParameters) error {
|
|
|
|
if parameters.authentication {
|
2018-07-24 14:11:35 +00:00
|
|
|
return handler.GitService.ClonePrivateRepositoryWithBasicAuth(parameters.url, parameters.referenceName, parameters.path, parameters.username, parameters.password)
|
2018-06-11 13:13:19 +00:00
|
|
|
}
|
2018-07-24 14:11:35 +00:00
|
|
|
return handler.GitService.ClonePublicRepository(parameters.url, parameters.referenceName, parameters.path)
|
2018-06-11 13:13:19 +00:00
|
|
|
}
|