branch: elpa/magit
commit bba06845de4538e19d8f0e765d0be31bb2e3e288
Author: Jonas Bernoulli <jo...@bernoul.li>
Commit: Jonas Bernoulli <jo...@bernoul.li>

    magit-process-insert-section: Improve file-path comparision
    
    Previously this check sometimes failed due to one path ending with
    a slash and the other not doing so, resulting in a "relative path"
    of "." needlessly being displayed.
    
    Don't go as far as using `file-equal-p' because that would be more
    expensive and while we should minimize the chances of that happening
    (as we have just done) it is okay to fail sometimes.
---
 lisp/magit-process.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lisp/magit-process.el b/lisp/magit-process.el
index 9f0b44948c6..e5ec6a8ab4c 100644
--- a/lisp/magit-process.el
+++ b/lisp/magit-process.el
@@ -706,8 +706,10 @@ Magit status buffer."
       (when magit-process-timestamp-format
         (insert (format-time-string magit-process-timestamp-format) " "))
       (let ((cmd (concat
-                  (and (not (equal (expand-file-name pwd)
-                                   (expand-file-name default-directory)))
+                  (and (not (equal
+                             (file-name-as-directory (expand-file-name pwd))
+                             (file-name-as-directory (expand-file-name
+                                                      default-directory))))
                        (concat (file-relative-name pwd default-directory) " "))
                   (magit-process--format-arguments program args))))
         (magit-insert-heading (if face (propertize cmd 'face face) cmd)))

Reply via email to