This commit is contained in:
fferro
2024-07-17 10:56:24 +01:00
parent e2d4055e4e
commit d5ad69131f
4 changed files with 6 additions and 12 deletions
+1 -2
View File
@@ -310,8 +310,7 @@ func (u *UserSettings) doLoadConfigs() {
u.onceErr = err
return
}
},
)
})
}
func parseFile(filename string, ignoreMatchDirective bool) (*Config, error) {
+3 -6
View File
@@ -460,8 +460,7 @@ func TestCustomFinder(t *testing.T) {
us := &UserSettings{}
us.ConfigFinder(func() string {
return "testdata/config1"
},
)
})
val := us.Get("wap", "User")
if val != "root" {
@@ -475,8 +474,7 @@ func TestCustomFinderWhenIgnoringMatchDirective(t *testing.T) {
}
us.ConfigFinder(func() string {
return "testdata/config1-with-match-directive"
},
)
})
val := us.Get("git.yahoo.com", "HostName")
if val != "git.proxy.com" {
@@ -488,8 +486,7 @@ func TestCustomFinderWhenNotIgnoringMatchDirective(t *testing.T) {
us := &UserSettings{}
us.ConfigFinder(func() string {
return "testdata/config1-with-match-directive"
},
)
})
val := us.Get("git.yahoo.com", "HostName")
if val != "" {
+1 -2
View File
@@ -53,7 +53,6 @@ func ExampleUserSettings_ConfigFinder() {
u := ssh_config.UserSettings{}
u.ConfigFinder(func() string {
return filepath.Join("testdata", "test_config")
},
)
})
u.Get("example.com", "Host")
}
+1 -2
View File
@@ -176,8 +176,7 @@ func (p *sshParser) parseComment() sshParserStateFn {
// account for the "#" as well
leadingSpace: comment.Position.Col - 2,
position: comment.Position,
},
)
})
return p.parseStart
}