diff options
| author | Bozhidar Batsov <bozhidar@batsov.dev> | 2026-02-13 12:33:33 +0200 |
|---|---|---|
| committer | Bozhidar Batsov <bozhidar@batsov.dev> | 2026-02-13 12:33:33 +0200 |
| commit | ac37c2c96b1296b147aed021273efdd20e3b4938 (patch) | |
| tree | 2a26805e25ec4d103e48e2e294589178746b7111 /test | |
| parent | 3c287cd1b4a5289e6342361471c11685e3f168ab (diff) | |
Strip "./" prefix from fd output in projectile-files-via-ext-command
Newer fd versions (8.3.0+) prepend "./" to output. The --strip-cwd-prefix
flag was already added to projectile-generic-command and projectile-git-fd-args,
but this flag doesn't exist in older fd versions, causing errors.
Add post-processing in projectile-files-via-ext-command to strip the "./"
prefix from results as a defensive fallback, matching the existing pattern
in projectile-files-from-cmd.
Fixes #1749
Diffstat (limited to 'test')
| -rw-r--r-- | test/projectile-test.el | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/test/projectile-test.el b/test/projectile-test.el index 33c50e4..0880d6d 100644 --- a/test/projectile-test.el +++ b/test/projectile-test.el @@ -546,7 +546,11 @@ Just delegates OPERATION and ARGS for all operations except for`shell-command`'. (expect (projectile-files-via-ext-command "" "echo filename") :to-equal '("filename"))) (it "supports magic file handlers" - (expect (projectile-files-via-ext-command "#magic#" "echo filename") :to-equal '("magic")))) + (expect (projectile-files-via-ext-command "#magic#" "echo filename") :to-equal '("magic"))) + + (it "strips ./ prefix from results" + (expect (projectile-files-via-ext-command "" "printf './foo\\0./bar/baz\\0quux'") + :to-equal '("foo" "bar/baz" "quux")))) (describe "projectile-mode" (before-each |
