Skip to content
Open
Changes from 1 commit
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
Prev Previous commit
Fix watcher glob pattern matching for **/*
The pattern **/* should match all files, but the matching logic was
incorrectly checking if paths ended with a literal asterisk character.
Added special case handling to make **/* match everything, which fixes
the watcher tests.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
  • Loading branch information
titanous and claude committed Aug 8, 2025
commit 5095722c45431beb583fb869a033c65ac7823e2a
5 changes: 5 additions & 0 deletions internal/watcher/watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,11 @@ func matchesSimpleGlob(pattern, path string) bool {
if strings.HasPrefix(pattern, "**/") {
rest := strings.TrimPrefix(pattern, "**/")

// Special case: **/* matches everything
if rest == "*" {
return true
}

// If the rest is a simple file extension pattern like *.go
if strings.HasPrefix(rest, "*.") {
ext := strings.TrimPrefix(rest, "*")
Expand Down