From 7d32b5ca2821d94721197bbb70927543cdc872b3 Mon Sep 17 00:00:00 2001 From: risk danger olson Date: Fri, 6 Jan 2017 14:38:57 -0700 Subject: [PATCH] lfsapi: don't export CommandCredentialHelper --- lfsapi/auth.go | 2 +- lfsapi/creds.go | 10 +++++----- lfsapi/lfsapi.go | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lfsapi/auth.go b/lfsapi/auth.go index aaf8d007..c78451a9 100644 --- a/lfsapi/auth.go +++ b/lfsapi/auth.go @@ -15,7 +15,7 @@ import ( ) var ( - defaultCredentialHelper = &CommandCredentialHelper{} + defaultCredentialHelper = &commandCredentialHelper{} defaultNetrcFinder = &noFinder{} defaultEndpointFinder = NewEndpointFinder(nil) ) diff --git a/lfsapi/creds.go b/lfsapi/creds.go index 10bd6cb3..498fb8ba 100644 --- a/lfsapi/creds.go +++ b/lfsapi/creds.go @@ -28,25 +28,25 @@ func (c Creds) Buffer() *bytes.Buffer { return buf } -type CommandCredentialHelper struct { +type commandCredentialHelper struct { SkipPrompt bool } -func (h *CommandCredentialHelper) Fill(creds Creds) (Creds, error) { +func (h *commandCredentialHelper) Fill(creds Creds) (Creds, error) { return h.exec("fill", creds) } -func (h *CommandCredentialHelper) Reject(creds Creds) error { +func (h *commandCredentialHelper) Reject(creds Creds) error { _, err := h.exec("reject", creds) return err } -func (h *CommandCredentialHelper) Approve(creds Creds) error { +func (h *commandCredentialHelper) Approve(creds Creds) error { _, err := h.exec("approve", creds) return err } -func (h *CommandCredentialHelper) exec(subcommand string, input Creds) (Creds, error) { +func (h *commandCredentialHelper) exec(subcommand string, input Creds) (Creds, error) { output := new(bytes.Buffer) cmd := exec.Command("git", "credential", subcommand) cmd.Stdin = input.Buffer() diff --git a/lfsapi/lfsapi.go b/lfsapi/lfsapi.go index 378d725e..ac083c70 100644 --- a/lfsapi/lfsapi.go +++ b/lfsapi/lfsapi.go @@ -72,7 +72,7 @@ func NewClient(osEnv Env, gitEnv Env) (*Client, error) { c := &Client{ Endpoints: NewEndpointFinder(gitEnv), - Credentials: &CommandCredentialHelper{ + Credentials: &commandCredentialHelper{ SkipPrompt: !osEnv.Bool("GIT_TERMINAL_PROMPT", true), }, Netrc: netrc,