@@ -13,7 +13,7 @@ import (
13
13
)
14
14
15
15
type NetrcFinder interface {
16
- FindMachine (string ) * netrc.Machine
16
+ FindMachine (string , string ) * netrc.Machine
17
17
}
18
18
19
19
func ParseNetrc (osEnv config.Environment ) (NetrcFinder , string , error ) {
@@ -33,7 +33,7 @@ func ParseNetrc(osEnv config.Environment) (NetrcFinder, string, error) {
33
33
34
34
type noFinder struct {}
35
35
36
- func (f * noFinder ) FindMachine (host string ) * netrc.Machine {
36
+ func (f * noFinder ) FindMachine (host string , loginName string ) * netrc.Machine {
37
37
return nil
38
38
}
39
39
@@ -72,7 +72,7 @@ func (c *netrcCredentialHelper) Fill(what Creds) (Creds, error) {
72
72
if c .skip [host ] {
73
73
return nil , credHelperNoOp
74
74
}
75
- if machine := c .netrcFinder .FindMachine (host ); machine != nil {
75
+ if machine := c .netrcFinder .FindMachine (host , what [ "username" ] ); machine != nil {
76
76
creds := make (Creds )
77
77
creds ["username" ] = machine .Login
78
78
creds ["password" ] = machine .Password
@@ -81,8 +81,8 @@ func (c *netrcCredentialHelper) Fill(what Creds) (Creds, error) {
81
81
creds ["scheme" ] = what ["scheme" ]
82
82
creds ["path" ] = what ["path" ]
83
83
creds ["source" ] = "netrc"
84
- tracerx .Printf ("netrc: git credential fill (%q, %q, %q)" ,
85
- what ["protocol" ], what ["host" ], what ["path" ])
84
+ tracerx .Printf ("netrc: git credential fill (%q, %q, %q, %q )" ,
85
+ what ["protocol" ], what ["host" ], machine . Login , what ["path" ])
86
86
return creds , nil
87
87
}
88
88
0 commit comments