fix: IsHiddenPath returns false for "." and "/" (current dir/root are not hidden)

path.Clean(".") returns "." which starts with a dot, causing IsHiddenPath
to incorrectly treat the current directory as hidden. Add explicit checks
for "." and "/" before the dot-prefix check.

Fixed in both mfer/scanner.go and internal/scanner/scanner.go.
This commit is contained in:
clawbot
2026-02-19 23:36:42 -08:00
committed by user
parent 1f12d10cb7
commit f6478858d7
2 changed files with 5 additions and 0 deletions
+2
View File
@@ -352,6 +352,8 @@ func TestIsHiddenPath(t *testing.T) {
{"/absolute/.hidden", true},
{"./relative", false}, // path.Clean removes leading ./
{"a/b/c/.d/e", true},
{".", false}, // current directory is not hidden
{"/", false}, // root is not hidden
}
for _, tt := range tests {