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

    magit-format-ref-labels: Remove ancient kludge
    
    Remove an ancient kludge, added in [1: 1314554cf4].
    Since TODO `--simplify-by-decoration' no longer causes the `full'
    in `--decorate=full' to be ignored.
    
    1: 2015-01-22 1314554cf40e48bfc391d8392bb97e382ec0b1a5
       magit-log-popup: add --simplify-by-decoration
---
 lisp/magit-git.el | 21 ++++-----------------
 1 file changed, 4 insertions(+), 17 deletions(-)

diff --git a/lisp/magit-git.el b/lisp/magit-git.el
index d0afadc9831..5b483e50948 100644
--- a/lisp/magit-git.el
+++ b/lisp/magit-git.el
@@ -2302,24 +2302,11 @@ and this option only controls what face is used.")
 
 (defun magit-format-ref-labels (string)
   (save-match-data
-    (let ((regexp "\\(, \\|tag: \\|HEAD -> \\)")
-          names)
-      (if (and (derived-mode-p 'magit-log-mode)
-               (member "--simplify-by-decoration" magit-buffer-log-args))
-          (let ((branches (magit-list-local-branch-names))
-                (re (format "^%s/.+" (regexp-opt (magit-list-remotes)))))
-            (setq names
-                  (--map (cond ((string-equal it "HEAD")     it)
-                               ((string-prefix-p "refs/" it) it)
-                               ((member it branches) (concat "refs/heads/" it))
-                               ((string-match re it) (concat "refs/remotes/" 
it))
-                               (t                    (concat "refs/" it)))
-                         (split-string
-                          (string-replace "tag: " "refs/tags/" string)
-                          regexp t))))
-        (setq names (split-string string regexp t)))
+    (let ((refs (split-string
+                 (replace-regexp-in-string "\\(tag: \\|HEAD -> \\)" "" string)
+                 ", " t)))
       (let (state head upstream tags branches remotes other combined)
-        (dolist (ref names)
+        (dolist (ref refs)
           (let* ((face (cdr (--first (string-match (car it) ref)
                                      magit-ref-namespaces)))
                  (name (magit--propertize-face

Reply via email to