Commit Graph

6 Commits

Author SHA1 Message Date
Taylor Blau
52b7f015f6 config,etc: rename EnvFetcher, config.Env to OsFetcher, config.Os 2016-08-04 14:41:04 -06:00
Taylor Blau
8ca4fcbade config: eradicate uses of SetAllEnv
The `SetAllEnv` function is one of two functions that allow for mutable
behavior within the `*config.Configuration` type. It is desirable for us to
remove that function, and all of its uses throughout the LFS codebase.

Unfortunately, a lot of `SetAllEnv` uses are coupled to initializing the
`config.Configuration` instance with custom `.gitconfig` data, a-la
`NewFromValues`. This coupling makes it difficult to write an atomic commit
that *only* removes the usage of `SetAllEnv`.

As a compromise, the signature of `NewFromValues` changed from:

```
func NewFromValues(gitconfig map[string]strimg) *Configuration
```

to...

```
type Values struct {
  Git, Env map[string]string
}

func NewFrom(v Values) *Configuration
```

To support reading fixed data as a part of the `Env` fetcher, a new Fetcher
type was introduced:

```
type mapFetcher map[string]string

func (m mapFetcher) Get(key string) (val string) { ... }
```

and is used in place of the old `*EnvFetcher` to retrieve data from the
"environment".
2016-08-03 17:55:39 -06:00
risk danger olson
4f71d45acd config.NewConfig() => config.New() 2016-07-21 17:38:44 -06:00
risk danger olson
e50af5137b prefer git config over HTTP_PROXY 2016-07-21 10:06:18 -06:00
Taylor Blau
7046d1f7c5 httputil/proxy: assert.Nil over assert.Equal(t, nil) 2016-07-14 10:43:57 -06:00
Taylor Blau
cb73a1900d lfs,httputil: move proxy test to httputil package 2016-07-14 10:43:20 -06:00