aboutsummaryrefslogtreecommitdiff
path: root/projectile.el
diff options
context:
space:
mode:
authorBozhidar Batsov <bozhidar@batsov.dev>2026-03-04 16:06:53 +0200
committerBozhidar Batsov <bozhidar@batsov.dev>2026-03-04 21:43:10 +0200
commitf51621adcee087c01262164d1fa32580030fc6e1 (patch)
treef1ca5365387c7d3d6cfede9257954773319bc012 /projectile.el
parentc0ae91cec393354491512abe48ec70e59e00436c (diff)
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.
Diffstat (limited to 'projectile.el')
-rw-r--r--projectile.el5
1 files 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."