Function: vc-git-branches
vc-git-branches is a byte-compiled function defined in vc-git.el.gz.
Signature
(vc-git-branches)
Documentation
Return the existing branches, as a list of strings.
The car of the list is the current branch.
Source Code
;; Defined in /usr/src/emacs/lisp/vc/vc-git.el.gz
(defun vc-git-branches ()
"Return the existing branches, as a list of strings.
The car of the list is the current branch."
(with-temp-buffer
(vc-git--call t "branch")
(goto-char (point-min))
(let (current-branch branches)
(while (not (eobp))
(when (looking-at "^\\([ *]\\) \\(.+\\)$")
(if (string-equal (match-string 1) "*")
(setq current-branch (match-string 2))
(push (match-string 2) branches)))
(forward-line 1))
(cons current-branch (nreverse branches)))))