* version.el (emacs-repository-get-version): Avoid error if .git exists but

the git executable is not found.
This commit is contained in:
Glenn Morris 2014-01-22 09:34:27 -08:00
parent 2a5bce4f0c
commit 983664c0b4
2 changed files with 5 additions and 2 deletions

View file

@ -4,6 +4,7 @@
Check either .bzr or .git, but not both.
Make the git case actually use the DIR argument, and return nil
rather than the empty string.
Avoid error if .git exists but the git executable is not found.
2014-01-22 Martin Rudalics <rudalics@gmx.at>

View file

@ -185,8 +185,10 @@ only ask the VCS if we cannot find any information ourselves."
(message "Waiting for git...")
(with-temp-buffer
(let ((default-directory (file-name-as-directory dir)))
(and (zerop (call-process "git" nil '(t nil) nil "log"
"-1" "--pretty=format:%N"))
(and (eq 0
(ignore-errors
(call-process "git" nil '(t nil) nil "log"
"-1" "--pretty=format:%N")))
(not (zerop (buffer-size)))
(replace-regexp-in-string "\n" "" (buffer-string))))))))