diff --git a/parse.go b/parse.go index 60a7ac6..793c9a2 100644 --- a/parse.go +++ b/parse.go @@ -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) diff --git a/parse_test.go b/parse_test.go index 24ec8c8..6021e4a 100644 --- a/parse_test.go +++ b/parse_test.go @@ -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 {