Skip to content

Commit

Permalink
[#1147] Don't convert paths returned by external commands to relative
Browse files Browse the repository at this point in the history
External tools should return relative paths by default. This
conversion was just one giant performance bottleneck.
  • Loading branch information
bbatsov committed Sep 29, 2018
1 parent 35231b1 commit e6a6b3d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions projectile.el
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,7 @@ Files are returned as relative paths to the project ROOT."
(if (eq projectile-indexing-method 'native)
(projectile-dir-files-native root directory)
;; use external tools to get the project files
(projectile-adjust-files (projectile-dir-files-external root directory))))))
(projectile-adjust-files (projectile-dir-files-external directory))))))

(defun projectile-dir-files-native (root directory)
"Get the files for ROOT under DIRECTORY using just Emacs Lisp."
Expand All @@ -1073,12 +1073,10 @@ Files are returned as relative paths to the project ROOT."
(projectile-index-directory directory (projectile-filtering-patterns)
progress-reporter))))

(defun projectile-dir-files-external (root directory)
"Get the files for ROOT under DIRECTORY using external tools."
(defun projectile-dir-files-external (directory)
"Get the files for DIRECTORY using external tools."
(let ((default-directory directory))
(mapcar (lambda (file)
(file-relative-name (expand-file-name file directory) root))
(projectile-get-repo-files))))
(projectile-get-repo-files)))

(defun projectile-get-ext-command ()
"Determine which external command to invoke based on the project's VCS."
Expand Down

0 comments on commit e6a6b3d

Please sign in to comment.