branch: externals/tramp-hlo
commit c93c61205e3afd894a656024c2560b9661b35fe0
Author: Joe Sadusk <[email protected]>
Commit: Joe Sadusk <[email protected]>

    Fixed dir-locals cache handling
---
 tramp-hlo.el | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/tramp-hlo.el b/tramp-hlo.el
index 9546b652a0..5214ebedc1 100644
--- a/tramp-hlo.el
+++ b/tramp-hlo.el
@@ -337,11 +337,12 @@ This function returns a plist with the fields:
      "dir_locals_find_file_cache_update")
     (let* ((file-connection (file-remote-p file))
            (cache-dirs-quoted
-            (cl-loop
-             for cache-entry in cache
-             when (string= file-connection (file-remote-p (car cache-entry)))
-             collect (tramp-shell-quote-argument
-                      (file-local-name (car cache-entry)))))
+            (seq-uniq
+             (cl-loop
+              for cache-entry in cache
+              when (string= file-connection (file-remote-p (car cache-entry)))
+              collect (tramp-shell-quote-argument
+                       (file-local-name (car cache-entry))))))
            (cache-dirs-string (string-join cache-dirs-quoted " "))
            (command
             (format
@@ -416,12 +417,13 @@ This function returns either:
                                  (setq latest f-time)))))))))
             ;; This cache entry is OK.
             dir-elt
+          (progn
           ;; This cache entry is invalid; clear it.
-          (setq dir-locals-directory-cache
-                (delq dir-elt dir-locals-directory-cache))
-          ;; Return the first existing dir-locals file.  Might be the same
-          ;; as dir-elt's, might not (eg latter might have been deleted).
-          locals-dir)
+            (setq dir-locals-directory-cache
+                  (delq dir-elt dir-locals-directory-cache))
+            ;; Return the first existing dir-locals file.  Might be the same
+            ;; as dir-elt's, might not (eg latter might have been deleted).
+            locals-dir))
       ;; No cache entry.
       locals-dir)))
 

Reply via email to