Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ func isAlphanumeric(ch rune) bool {
// isPatternChar matches characters that are allowed in patterns
func isPatternChar(ch rune) bool {
switch ch {
case '*', '?', '.', '/', '@', '_', '+', '-', '\\', '(', ')', '|', '{', '}':
case '*', '?', '.', '/', '@', '_', '+', '-', '\\', '(', ')', '|', '{', '}', '~':
return true
}
return isAlphanumeric(ch)
Expand Down
8 changes: 8 additions & 0 deletions parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,14 @@ func TestParseRule(t *testing.T) {
Owners: []Owner{{Value: "org/team", Type: "team"}},
},
},
{
name: "pattern with tilde '~'",
rule: "foobar~.txt @org/team",
expected: Rule{
pattern: mustBuildPattern(t, "foobar~.txt"),
Owners: []Owner{{Value: "org/team", Type: "team"}},
},
},

// Error cases
{
Expand Down