Commit 7f0906ec authored by Jonas Bernoulli's avatar Jonas Bernoulli

magit-insert-branch: BRANCH argument is nil for detached head

Previously this function assumed BRANCH would be "HEAD" when
the head is detached, but actually it is nil in that case.
parent 418748fb
......@@ -487,11 +487,11 @@ line is inserted at all."
"For internal use, don't add to a hook."
(unless magit-refs-show-commit-count
(setq format (replace-regexp-in-string "%[0-9]\\([cC]\\)" "%1\\1" format t)))
(if (equal branch "HEAD")
(magit-insert-section it (commit (magit-rev-parse "HEAD") t)
(apply #'magit-insert-branch-1 it nil format args))
(magit-insert-section it (branch branch t)
(apply #'magit-insert-branch-1 it branch format args))))
(if branch
(magit-insert-section it (branch branch t)
(apply #'magit-insert-branch-1 it branch format args))
(magit-insert-section it (commit (magit-rev-parse "HEAD") t)
(apply #'magit-insert-branch-1 it nil format args))))
(defun magit-insert-branch-1
(section branch format current branches face
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment