emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] scratch/dired-git-info 7755019 32/33: Get commit info from real f


From: Clemens Radermacher
Subject: [elpa] scratch/dired-git-info 7755019 32/33: Get commit info from real file name
Date: Sun, 17 Feb 2019 13:03:32 -0500 (EST)

branch: scratch/dired-git-info
commit 7755019e7a94a35d54d121b32beca9962e8f490f
Author: Clemens Radermacher <address@hidden>
Commit: Clemens Radermacher <address@hidden>

    Get commit info from real file name
---
 dired-git-info.el | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/dired-git-info.el b/dired-git-info.el
index 7ae2a89..09df3d4 100644
--- a/dired-git-info.el
+++ b/dired-git-info.el
@@ -96,19 +96,13 @@ are (see git-log PRETTY FORMATS for all):
 
 FILE default to current dired file. GITF determines the commit
 info format and defaults to `dgi-commit-message-format'."
-  (let* ((file (or file (dired-get-file-for-visit)))
-         (lfile (and (file-exists-p file)
-                     ;; get the actual displayed name, to make it work with
-                     ;; dired collapse for example
-                     (save-excursion
-                       (dired-goto-file file)
-                       (buffer-substring (point) (line-end-position))))))
-    (when (and lfile (not (member lfile '(".." "."))))
+  (let ((file (or file (dired-get-file-for-visit))))
+    (when (and file (file-exists-p file))
       (let ((msg (dgi--command-to-string
                   "git" "log" "-1"
                   (concat "--pretty="
                           (or gitf dgi-commit-message-format))
-                  lfile)))
+                  file)))
         (when (and msg (not (string= "" msg)))
           (substring msg
                      ;; skip newline



reply via email to

[Prev in Thread] Current Thread [Next in Thread]