branch: elpa/projectile
commit f51621adcee087c01262164d1fa32580030fc6e1
Author: Bozhidar Batsov <[email protected]>
Commit: Bozhidar Batsov <[email protected]>

    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 a0d7e87ceb..3e3dbac606 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."

Reply via email to