]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/version.el (emacs-repository-version-git): Demote errors.
authorGlenn Morris <rgm@gnu.org>
Sun, 14 Jun 2015 23:33:05 +0000 (16:33 -0700)
committerGlenn Morris <rgm@gnu.org>
Sun, 14 Jun 2015 23:33:05 +0000 (16:33 -0700)
Check result is a hash.

lisp/version.el

index 112611d10834bff4e072f03ba758e1f4349f7e56..c0b975ed31ba381844b0404b1d91c64d6733b517 100644 (file)
@@ -106,10 +106,11 @@ or if we could not determine the revision.")
   (with-temp-buffer
     (let ((default-directory (file-name-as-directory dir)))
       (and (eq 0
-              (ignore-errors
+              (with-demoted-errors "Error running git rev-parse: %S"
                 (call-process "git" nil '(t nil) nil "rev-parse" "HEAD")))
-          (not (zerop (buffer-size)))
-          (replace-regexp-in-string "\n" "" (buffer-string))))))
+          (progn (goto-char (point-min))
+                 (looking-at "[0-9a-fA-F]\\{40\\}"))
+          (match-string 0)))))
 
 (defun emacs-repository--version-git-1 (file)
   "Internal subroutine of `emacs-repository-get-version'."