From 5137f2cf25a71cfaf6d7794d86ea2ed52bb001d3 Mon Sep 17 00:00:00 2001 From: Bernhard Guillon Date: Mon, 6 Jul 2026 21:47:30 +0200 Subject: Docker test fixes: directory pattern matching, mtime-based sync, Go version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fixed directory pattern matching: go-gitignore doesn't match 'build/' against bare 'build', now checks with trailing slash appended - Added ModTime to FileMeta for reliable change detection (same-size file modifications now sync correctly) - Updated Dockerfile to golang:1.24-alpine (was 1.22) - Downgraded go.mod to Go 1.24 (system has custom 1.26.4 build) Docker tested with podman: - Initial sync correctly excludes ignored dirs/files - Nested .gitignore works (sub/ ignores *.tmp) - Watcher syncs new/modified/deleted files - Case-sensitive rename (Foo→foo) handled correctly - Same-size file modifications sync correctly --- gitignore.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gitignore.go') diff --git a/gitignore.go b/gitignore.go index 569e191..2c9fc4b 100644 --- a/gitignore.go +++ b/gitignore.go @@ -50,8 +50,8 @@ func (s *GitignoreStack) IsIgnored(relPath string) bool { continue } - posMatch := layer.posRules != nil && layer.posRules.MatchesPath(childRel) - negMatch := layer.negRules != nil && layer.negRules.MatchesPath(childRel) + posMatch := layer.posRules != nil && (layer.posRules.MatchesPath(childRel) || layer.posRules.MatchesPath(childRel+"/")) + negMatch := layer.negRules != nil && (layer.negRules.MatchesPath(childRel) || layer.negRules.MatchesPath(childRel+"/")) if negMatch { result = false -- cgit v1.2.3