Commit Graph

10 Commits

Author SHA1 Message Date
Taylor Blau
0c134d4a2a httputil: enforce config immutability 2016-08-09 10:57:58 -06:00
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
Taylor Blau
f436202a9c Merge branch 'master' into commands-config 2016-08-01 12:50:18 -06:00
Dakota Hawkins
24cab8ad99 Fix #1403: sslCAInfo config lookup when host in config doesn't have a trailing slash
appendRootCAsForHostFromGitconfig() modified to check hosts with and without a trailing slash.

Cert unit tests made "table driven" and extended to cover this case.
2016-07-28 17:09:31 -04:00
risk danger olson
b9c5a108d9 replace config.Config references in httputil 2016-07-21 18:07:23 -06:00
Taylor Blau
fc1daa28e3 lfs: use github.com/stretchr/testify for assertions 2016-05-25 10:43:10 -06:00
Taylor Blau
4593d0a641 vendor: vendor dependencies in vendor/ using Glide
- script/vendor received an update in order to work with Glide
- import paths have been rewritten to work with GO15VENDOREXPERIMENT
2016-05-23 12:10:35 -06:00
Steve Streeting
b6c09601ce Fix new package tests 2016-05-17 14:40:05 +01:00
Steve Streeting
c4bbd3724e Major refactor to pull things into config, httputil, tools
Mainly required to avoid cyclical dependencies when separating other things
2016-05-13 17:38:06 +01:00