From f51621adcee087c01262164d1fa32580030fc6e1 Mon Sep 17 00:00:00 2001 From: Bozhidar Batsov Date: Wed, 4 Mar 2026 16:06:53 +0200 Subject: Fix projectile-files-to-ensure expanding wildcards in wrong directory file-expand-wildcards uses default-directory for relative patterns, which was whatever the current buffer had rather than the project root. Bind default-directory to the project root and return relative paths so projectile-expand-paths resolves them correctly downstream. --- projectile.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/projectile.el b/projectile.el index a0d7e87..3e3dbac 100644 --- a/projectile.el +++ b/projectile.el @@ -2126,8 +2126,9 @@ Unignored files/directories are not included." (projectile-normalise-paths (caddr (projectile-parse-dirconfig-file)))) (defun projectile-files-to-ensure () - (flatten-tree (mapcar (lambda (pat) (file-expand-wildcards pat t)) - (projectile-patterns-to-ensure)))) + (let ((default-directory (projectile-project-root))) + (flatten-tree (mapcar #'file-expand-wildcards + (projectile-patterns-to-ensure))))) (defun projectile-patterns-to-ensure () "Return a list of relative file patterns." -- cgit v1.0