Skip to content

Commit

Permalink
Merge pull request git-lfs#776 from github/safe-config
Browse files Browse the repository at this point in the history
change whitelist var name
  • Loading branch information
technoweenie committed Oct 23, 2015
2 parents 0d09a0d + 6e6eb62 commit 9fdc0bc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lfs/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,15 +337,15 @@ func (c *Configuration) loadGitConfig() bool {
return true
}

func (c *Configuration) readGitConfig(output string, uniqRemotes map[string]bool, whitelisted bool) {
func (c *Configuration) readGitConfig(output string, uniqRemotes map[string]bool, onlySafe bool) {
lines := strings.Split(output, "\n")
for _, line := range lines {
pieces := strings.SplitN(line, "=", 2)
if len(pieces) < 2 {
continue
}

allowed := !whitelisted
allowed := !onlySafe
key := strings.ToLower(pieces[0])
value := pieces[1]

Expand All @@ -355,12 +355,12 @@ func (c *Configuration) readGitConfig(output string, uniqRemotes map[string]bool
ext := c.extensions[name]
switch keyParts[3] {
case "clean":
if whitelisted {
if onlySafe {
continue
}
ext.Clean = value
case "smudge":
if whitelisted {
if onlySafe {
continue
}
ext.Smudge = value
Expand All @@ -375,7 +375,7 @@ func (c *Configuration) readGitConfig(output string, uniqRemotes map[string]bool
ext.Name = name
c.extensions[name] = ext
} else if len(keyParts) > 1 && keyParts[0] == "remote" {
if whitelisted && (len(keyParts) < 3 || keyParts[2] != "lfsurl") {
if onlySafe && (len(keyParts) == 3 && keyParts[2] != "lfsurl") {
continue
}

Expand Down

0 comments on commit 9fdc0bc

Please sign in to comment.