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

    magit-diff-visit--range-to: Don't handle magit-diff-visit-avoid-head-blob
---
 lisp/magit-diff.el | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/lisp/magit-diff.el b/lisp/magit-diff.el
index d82b9d167b3..b4b2f3afe09 100644
--- a/lisp/magit-diff.el
+++ b/lisp/magit-diff.el
@@ -1753,7 +1753,12 @@ the Magit-Status buffer for DIRECTORY."
        (spec (magit-diff--dwim))
        (rev  (if goto-from
                  (magit-diff-visit--range-from spec)
-               (magit-diff-visit--range-to spec)))
+               (let ((rev (magit-diff-visit--range-to spec)))
+                 (if (and (stringp rev)
+                          magit-diff-visit-avoid-head-blob
+                          (magit-rev-head-p rev))
+                     'unstaged
+                   rev))))
        (buffer (magit-find-file-noselect
                 (cond ((or goto-file
                            (equal magit-buffer-typearg "--no-index")
@@ -1860,15 +1865,11 @@ the Magit-Status buffer for DIRECTORY."
          spec)))
 
 (defun magit-diff-visit--range-to (spec)
-  (if (symbolp spec)
-      spec
-    (let ((rev (if (consp spec)
-                   (cdr spec)
-                 (cdr (magit-split-range spec)))))
-      (if (and magit-diff-visit-avoid-head-blob
-               (magit-rev-head-p rev))
-          'unstaged
-        rev))))
+  (cond ((symbolp spec)
+         spec)
+        ((consp spec)
+         (cdr spec))
+        ((cdr (magit-split-range spec)))))
 
 (defun magit-diff-visit--offset (file rev line)
   (let ((offset 0))

Reply via email to