Skip to content

Commit

Permalink
Fix the factory for git
Browse files Browse the repository at this point in the history
Signed-off-by: Dylan Murray <[email protected]>
  • Loading branch information
dymurray committed Jan 10, 2024
1 parent fbfcf7b commit 279902c
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions repository/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,9 @@ func (r *Git) Validate() (err error) {
if err != nil {
return
}
insecure, err := addon.Setting.Bool("git.insecure.enabled")
if err != nil {
return
}
switch u.Scheme {
case "http":
if !insecure {
if !r.Insecure {
err = errors.New("http URL used with git.insecure.enabled = FALSE")
return
}
Expand Down Expand Up @@ -151,10 +147,7 @@ func (r *Git) writeConfig() (err error) {
path)
return
}
insecure, err := addon.Setting.Bool("git.insecure.enabled")
if err != nil {
return
}

proxy, err := r.proxy()
if err != nil {
return
Expand All @@ -165,7 +158,7 @@ func (r *Git) writeConfig() (err error) {
s += "[credential]\n"
s += "helper = store\n"
s += "[http]\n"
s += fmt.Sprintf("sslVerify = %t\n", !insecure)
s += fmt.Sprintf("sslVerify = %t\n", !r.Insecure)
if proxy != "" {
s += fmt.Sprintf("proxy = %s\n", proxy)
}
Expand All @@ -181,7 +174,6 @@ func (r *Git) writeConfig() (err error) {
return
}

//
// writeCreds writes credentials (store) file.
func (r *Git) writeCreds(id *api.Identity) (err error) {
if id.User == "" || id.Password == "" {
Expand Down

0 comments on commit 279902c

Please sign in to comment.