Merge pull request #1428 from github/config-next-load-unmarshal

config-next: ensure .gitconfig is loaded before Unmarshal call
This commit is contained in:
Taylor Blau 2016-08-09 16:13:49 -06:00 committed by GitHub
commit 01cd862cbb

@ -131,6 +131,8 @@ func NewFrom(v Values) *Configuration {
// Otherwise, the field will be set to the value of calling the
// appropriately-typed method on the specified environment.
func (c *Configuration) Unmarshal(v interface{}) error {
c.loadGitConfig()
into := reflect.ValueOf(v)
if into.Kind() != reflect.Ptr {
return fmt.Errorf("lfs/config: unable to parse non-pointer type of %T", v)