refactor: replace PathSpec "gitignore" pattern type with "gitwildmatch"
- Update PathSpec.from_lines calls to use "gitwildmatch" instead of "gitignore" pattern type - Apply change across backup service (create and restore operations), file tree helper, and promptinclude plugin scanner - Aligns with pathspec library's preferred pattern matching syntax
frdel committed
Mar 22, 2026 at 21:50 UTC
723225957ecb6e3b278b51cff254765efe36caf5
3 files changed
+5
-5
helpers/backup.py
+3
-3
@@ -261,7 +261,7 @@ class BackupService:
261
processed_count = 0
262
263
try:
264
- spec = PathSpec.from_lines("gitignore", pattern_lines)
264
+ spec = PathSpec.from_lines("gitwildmatch", pattern_lines)
265
266
# Walk through base directories
267
for base_pattern_path, base_real_path in self.base_paths.items():
@@ -507,7 +507,7 @@ class BackupService:
507
508
if pattern_lines:
509
from pathspec import PathSpec
510
- restore_spec = PathSpec.from_lines("gitignore", pattern_lines)
510
+ restore_spec = PathSpec.from_lines("gitwildmatch", pattern_lines)
511
512
# Process each file in archive
513
for archive_path in archive_files:
@@ -663,7 +663,7 @@ class BackupService:
663
664
if pattern_lines:
665
from pathspec import PathSpec
666
- restore_spec = PathSpec.from_lines("gitignore", pattern_lines)
666
+ restore_spec = PathSpec.from_lines("gitwildmatch", pattern_lines)
667
668
# Process each file in archive
669
for archive_path in archive_files:
helpers/file_tree.py
+1
-1
@@ -502,7 +502,7 @@ def _resolve_ignore_patterns(ignore: str | None, root_abs_path: str) -> Optional
502
if not lines:
503
return None
504
505
- return PathSpec.from_lines("gitignore", lines)
505
+ return PathSpec.from_lines("gitwildmatch", lines)
506
507
508
def _list_directory_children(
plugins/_promptinclude/helpers/scanner.py
+1
-1
@@ -131,7 +131,7 @@ def _build_ignore_spec(gitignore: str) -> PathSpec | None:
131
]
132
if not lines:
133
return None
134
- return PathSpec.from_lines("gitignore", lines)
134
+ return PathSpec.from_lines("gitwildmatch", lines)
135
136
137
def _find_matching_files(