diff options
| author | Bozhidar Batsov <bozhidar@batsov.dev> | 2026-03-02 23:13:58 +0200 |
|---|---|---|
| committer | Bozhidar Batsov <bozhidar@batsov.dev> | 2026-03-04 21:43:10 +0200 |
| commit | 6f637948596bc7aff9fb0ac1cc88d910512bb488 (patch) | |
| tree | 95613a4dc6f27fcbf592609957745cbafbbf53ca /projectile.el | |
| parent | 4469d33f4921432e67b98151eeb6b4c2a17d648e (diff) | |
Don't execute empty string as shell command for non-git sub-projects
projectile-get-sub-projects-command returned "" for non-git VCSes,
which passed the stringp guard in projectile-files-via-ext-command
and spawned a useless shell process. Return nil instead, and also
make the guard defensive against empty strings to match the
docstring's contract.
Diffstat (limited to 'projectile.el')
| -rw-r--r-- | projectile.el | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/projectile.el b/projectile.el index cc99ea4..6c833af 100644 --- a/projectile.el +++ b/projectile.el @@ -1617,7 +1617,7 @@ Currently that's supported just for Git (sub-projects being Git sub-modules there)." (pcase vcs ('git projectile-git-submodule-command) - (_ ""))) + (_ nil))) (defun projectile-get-ext-ignored-command (vcs) "Determine which external command to invoke based on the project's VCS." @@ -1703,7 +1703,7 @@ If `command' is nil or an empty string, return nil. This allows commands to be disabled. Only text sent to standard output is taken into account." - (when (stringp command) + (when (and (stringp command) (not (string-empty-p command))) (let ((default-directory root)) (with-temp-buffer (shell-command command t "*projectile-files-errors*") |
