Skip to content

Commit c69a3c2

Browse files
committed
Fixups
1 parent 45ff18f commit c69a3c2

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

server/core/config/raw/autodiscover_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,11 @@ func TestAutoDiscover_Validate(t *testing.T) {
145145
input: raw.AutoDiscover{
146146
Mode: &autoDiscoverAuto,
147147
IgnorePaths: []string{
148-
"/foo",
149148
"foo",
149+
"foo[",
150150
},
151151
},
152-
errContains: String("pattern must not begin with a slash '/'"),
152+
errContains: String("invalid pattern: foo["),
153153
},
154154
}
155155
for _, c := range cases {

server/core/config/raw/repo_cfg_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ allowed_regexp_prefixes:
162162
Version: Int(3),
163163
AutoDiscover: &raw.AutoDiscover{
164164
Mode: &autoDiscoverEnabled,
165-
IgnorePaths: []string{"/foo.*/"},
165+
IgnorePaths: []string{"foo/*"},
166166
},
167167
Automerge: Bool(true),
168168
ParallelApply: Bool(true),

server/core/config/valid/repo_cfg.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,7 @@ func (r RepoCfg) IsPathIgnoredForAutoDiscover(path string) (bool, error) {
121121
matches, err := doublestar.Match(r.AutoDiscover.IgnorePaths[i], path)
122122
if err != nil {
123123
// Per documentation https://pkg.go.dev/github.com/bmatcuk/doublestar, this only
124-
// occurs if the pattern itself is invalid, and we already checked this when
125-
// parsing raw config
124+
// occurs if the pattern itself is invalid, and we already checked this when parsing raw config
126125
return false, errors.Wrap(err, "unexpectedly found invalid ignore pattern (this is a bug, should have been validated at startup)")
127126
}
128127
if matches {

0 commit comments

Comments
 (0)