lfsapi: remove *config.Configuration use
This commit is contained in:
parent
ce5f9be2c3
commit
29773dc02c
@ -37,8 +37,8 @@ type credsConfig struct {
|
||||
//
|
||||
// It returns an error if any configuration was invalid, or otherwise
|
||||
// un-useable.
|
||||
func getCredentialHelper(cfg *config.Configuration) (CredentialHelper, error) {
|
||||
ccfg, err := getCredentialConfig(cfg)
|
||||
func getCredentialHelper(osEnv, gitEnv config.Environment) (CredentialHelper, error) {
|
||||
ccfg, err := getCredentialConfig(osEnv, gitEnv)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -71,9 +71,7 @@ func getCredentialHelper(cfg *config.Configuration) (CredentialHelper, error) {
|
||||
|
||||
// getCredentialConfig parses a *credsConfig given the OS and Git
|
||||
// configurations.
|
||||
func getCredentialConfig(cfg *config.Configuration) (*credsConfig, error) {
|
||||
g := cfg.Git
|
||||
o := cfg.Os
|
||||
func getCredentialConfig(o, g config.Environment) (*credsConfig, error) {
|
||||
askpass, ok := o.Get("GIT_ASKPASS")
|
||||
if !ok {
|
||||
askpass, ok = g.Get("core.askpass")
|
||||
|
@ -66,8 +66,7 @@ func NewClient(osEnv Env, gitEnv Env) (*Client, error) {
|
||||
return nil, errors.Wrap(err, fmt.Sprintf("bad netrc file %s", netrcfile))
|
||||
}
|
||||
|
||||
creds, err := getCredentialHelper(&config.Configuration{
|
||||
Os: osEnv, Git: gitEnv})
|
||||
creds, err := getCredentialHelper(osEnv, gitEnv)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "cannot find credential helper(s)")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user