From f8a08c8a55efbaecc8a99bf39b63d85b3d89170d Mon Sep 17 00:00:00 2001 From: Shulhan Date: Thu, 15 Jan 2026 15:54:41 +0700 Subject: lib/git: handle pattern "**/foo/**" The "**/foo/**" means accept any files as long as there is foo directory in the middle. --- lib/git/ignore_pattern_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib/git/ignore_pattern_test.go') diff --git a/lib/git/ignore_pattern_test.go b/lib/git/ignore_pattern_test.go index c90620ba..54c4e9e9 100644 --- a/lib/git/ignore_pattern_test.go +++ b/lib/git/ignore_pattern_test.go @@ -78,6 +78,16 @@ func TestParseIgnorePattern(t *testing.T) { exp: IgnorePattern{ pattern: regexp.MustCompile(`^(.*/|/)?[^/]*foo/?$`), }, + }, { + pattern: `**/foo/**`, + exp: IgnorePattern{ + pattern: regexp.MustCompile(`^(.*/|/)?foo/(.*)/?$`), + }, + }, { + pattern: `foo/**`, + exp: IgnorePattern{ + pattern: regexp.MustCompile(`^/?foo/(.*)/?$`), + }, }, { pattern: `foo`, exp: IgnorePattern{ -- cgit v1.3