From 29773dc02c012e3180dc71d4bc3de492fc92557c Mon Sep 17 00:00:00 2001 From: rick olson Date: Wed, 18 Oct 2017 15:52:08 -0600 Subject: [PATCH] lfsapi: remove *config.Configuration use --- lfsapi/creds.go | 8 +++----- lfsapi/lfsapi.go | 3 +-- 2 files changed, 4 insertions(+), 7 deletions(-) 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)") }