Explorar o código

org-attach.el: Check whether git is installed

* org-attach.el (vc-git): Require.
(org-attach-commit): Check whether git is installed.

Thanks to Jonathan Leech-Pepin for reporting this.
Bastien Guerry %!s(int64=11) %!d(string=hai) anos
pai
achega
6a86f32c70
Modificáronse 1 ficheiros con 2 adicións e 3 borrados
  1. 2 3
      lisp/org-attach.el

+ 2 - 3
lisp/org-attach.el

@@ -41,8 +41,7 @@
   (require 'cl))
 (require 'org-id)
 (require 'org)
-
-(declare-function vc-git-root "vc-git" (file))
+(require 'vc-git)
 
 (defgroup org-attach nil
   "Options concerning entry attachments in Org-mode."
@@ -266,7 +265,7 @@ This checks for the existence of a \".git\" directory in that directory."
   (let* ((dir (expand-file-name org-attach-directory))
 	 (git-dir (vc-git-root dir))
 	 (changes 0))
-    (when git-dir
+    (when (and git-dir (executable-find "git"))
       (with-temp-buffer
 	(cd dir)
 	(let ((have-annex