branch: elpa/git-commit
commit a5f6705bf9a0b040a77eba67bafeec51ada90649
Author: Greg Steuck <[email protected]>
Commit: Jonas Bernoulli <[email protected]>

    magit-list-refs: Exclude case-sensitive HEAD from branch list
    
    This allows people who named their branch "head" to still see them.
    
    Fixes #4575.
---
 lisp/magit-git.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/magit-git.el b/lisp/magit-git.el
index 3eb355a85c..f18a9062ef 100644
--- a/lisp/magit-git.el
+++ b/lisp/magit-git.el
@@ -1691,7 +1691,9 @@ SORTBY is a key or list of keys to pass to the `--sort' 
flag of
                                         ((and val (pred listp)) val)))
                                (or namespaces magit-list-refs-namespaces))))
     (if (member format '("%(refname)" "%(refname:short)"))
-        (--remove (string-match-p "\\(\\`\\|/\\)HEAD\\'" it) refs)
+        (let ((case-fold-search nil))
+          (--remove (string-match-p "\\(\\`\\|/\\)HEAD\\'" it)
+                    refs))
       refs)))
 
 (defun magit-list-branches ()

Reply via email to