emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 1f9974a: * lisp/version.el (emacs-repository-versio


From: Glenn Morris
Subject: [Emacs-diffs] master 1f9974a: * lisp/version.el (emacs-repository-version-git): Demote errors.
Date: Sun, 14 Jun 2015 23:33:16 +0000

branch: master
commit 1f9974ad837b0ae3967dd126789ee7f7b04da8f9
Author: Glenn Morris <address@hidden>
Commit: Glenn Morris <address@hidden>

    * lisp/version.el (emacs-repository-version-git): Demote errors.
    
    Check result is a hash.
---
 lisp/version.el |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/lisp/version.el b/lisp/version.el
index 112611d..c0b975e 100644
--- a/lisp/version.el
+++ b/lisp/version.el
@@ -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'."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]