Function: emacs-repository-branch-git

emacs-repository-branch-git is a byte-compiled function defined in version.el.gz.

Signature

(emacs-repository-branch-git DIR)

Documentation

Ask git itself for the branch information for directory DIR.

Source Code

;; Defined in /usr/src/emacs/lisp/version.el.gz
(defun emacs-repository-branch-git (dir)
  "Ask git itself for the branch information for directory DIR."
  (message "Waiting for git...")
  (with-temp-buffer
    (let ((default-directory (file-name-as-directory dir)))
      (and (zerop
	    (with-demoted-errors "Error running git rev-parse --abbrev-ref: %S"
	      (call-process "git" nil '(t nil) nil
                            "rev-parse" "--abbrev-ref" "HEAD")))
           (goto-char (point-min))
           (buffer-substring (point) (line-end-position))))))