diff --git a/lfsapi/creds.go b/lfsapi/creds.go index 6a5f2e3b..187043b1 100644 --- a/lfsapi/creds.go +++ b/lfsapi/creds.go @@ -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") diff --git a/lfsapi/lfsapi.go b/lfsapi/lfsapi.go index d2c5392d..91bf3472 100644 --- a/lfsapi/lfsapi.go +++ b/lfsapi/lfsapi.go @@ -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)") }