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

    magit-thingatpt--git-revision: Only recognize painted references
    
    In [1: a07b46fbe3] we started to ignore text that matches the name of
    a reference but is propertized using a face that does not appear in
    `magit-revision-faces', but if the text is not propertized, then we
    continued to treated it as a revision or reference.  Now we insist on
    the use of a revision or reference face.  Users who want to revert to
    the old behavior can add nil to `magit-revision-faces'.
    
    Closes #4115.
    
    1: 2022-06-03 a07b46fbe3bf3f4737be812c4bd42a85db012a9a
       magit-thingatpt--git-revision: Avoid some false-positives
---
 lisp/magit-git.el | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/lisp/magit-git.el b/lisp/magit-git.el
index a7c37afdd4..d1cf573d63 100644
--- a/lisp/magit-git.el
+++ b/lisp/magit-git.el
@@ -2529,9 +2529,8 @@ and this option only controls what face is used.")
                       (string-match-p "[a-z]" string)
                       (magit-commit-p string))
                  (and (magit-ref-p string)
-                      (let ((face (get-text-property (point) 'face)))
-                        (or (not face)
-                            (member face magit-revision-faces)))))
+                      (member (get-text-property (point) 'face)
+                              magit-revision-faces)))
              string)))))
 
 (put 'git-revision-range 'thing-at-point #'magit-thingatpt--git-revision-range)

Reply via email to