Skip to content

Commit

Permalink
Fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
lukemassa committed Jan 23, 2025
1 parent 45ff18f commit c69a3c2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions server/core/config/raw/autodiscover_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,11 @@ func TestAutoDiscover_Validate(t *testing.T) {
input: raw.AutoDiscover{
Mode: &autoDiscoverAuto,
IgnorePaths: []string{
"/foo",
"foo",
"foo[",
},
},
errContains: String("pattern must not begin with a slash '/'"),
errContains: String("invalid pattern: foo["),
},
}
for _, c := range cases {
Expand Down
2 changes: 1 addition & 1 deletion server/core/config/raw/repo_cfg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ allowed_regexp_prefixes:
Version: Int(3),
AutoDiscover: &raw.AutoDiscover{
Mode: &autoDiscoverEnabled,
IgnorePaths: []string{"/foo.*/"},
IgnorePaths: []string{"foo/*"},
},
Automerge: Bool(true),
ParallelApply: Bool(true),
Expand Down
3 changes: 1 addition & 2 deletions server/core/config/valid/repo_cfg.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,7 @@ func (r RepoCfg) IsPathIgnoredForAutoDiscover(path string) (bool, error) {
matches, err := doublestar.Match(r.AutoDiscover.IgnorePaths[i], path)
if err != nil {
// Per documentation https://pkg.go.dev/github.com/bmatcuk/doublestar, this only
// occurs if the pattern itself is invalid, and we already checked this when
// parsing raw config
// occurs if the pattern itself is invalid, and we already checked this when parsing raw config
return false, errors.Wrap(err, "unexpectedly found invalid ignore pattern (this is a bug, should have been validated at startup)")
}
if matches {
Expand Down

0 comments on commit c69a3c2

Please sign in to comment.