diff options
author | Sébastien Delafond <sdelafond@gmail.com> | 2014-07-13 13:35:29 +0200 |
---|---|---|
committer | Sébastien Delafond <sdelafond@gmail.com> | 2014-07-13 13:35:29 +0200 |
commit | 40ce6b75e6245659a3a14622356e32e7dd1125dd (patch) | |
tree | 7d0051414493a78c84a3dfbec6143883c2ba8341 /lisp/org-attach.el | |
parent | e32a45ed36d6000db4b39171149072d11b77af72 (diff) |
Imported Upstream version 8.2.1
Diffstat (limited to 'lisp/org-attach.el')
-rw-r--r-- | lisp/org-attach.el | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lisp/org-attach.el b/lisp/org-attach.el index faefa6b..898d911 100644 --- a/lisp/org-attach.el +++ b/lisp/org-attach.el @@ -42,6 +42,8 @@ (require 'org-id) (require 'org) +(declare-function vc-git-root "vc-git" (file)) + (defgroup org-attach nil "Options concerning entry attachments in Org-mode." :tag "Org Attach" @@ -261,14 +263,15 @@ the ATTACH_DIR property) their own attachment directory." (defun org-attach-commit () "Commit changes to git if `org-attach-directory' is properly initialized. This checks for the existence of a \".git\" directory in that directory." - (let ((dir (expand-file-name org-attach-directory)) - (changes 0)) - (when (file-exists-p (expand-file-name ".git" dir)) + (let* ((dir (expand-file-name org-attach-directory)) + (git-dir (vc-git-root dir)) + (changes 0)) + (when git-dir (with-temp-buffer (cd dir) (let ((have-annex (and org-attach-git-annex-cutoff - (file-exists-p (expand-file-name ".git/annex" dir))))) + (file-exists-p (expand-file-name "annex" git-dir))))) (dolist (new-or-modified (split-string (shell-command-to-string |