Browse Source

Fix default directory for git-annex checks

* lisp/org-attach.el: (org-attach-annex-get-maybe) Ensure shell
  command that checks whether a git-annex file exists is called from
  within the git-annex repository. Otherwise, it will result in an
  error.
Matt Lundin 7 years ago
parent
commit
407014e068
1 changed files with 2 additions and 1 deletions
  1. 2 1
      lisp/org-attach.el

+ 2 - 1
lisp/org-attach.el

@@ -319,7 +319,8 @@ the ATTACH_DIR property) their own attachment directory."
 (defun org-attach-annex-get-maybe (path)
 (defun org-attach-annex-get-maybe (path)
   "Call git annex get PATH (via shell) if using git annex.
   "Call git annex get PATH (via shell) if using git annex.
 Signals an error if the file content is not available and it was not retrieved."
 Signals an error if the file content is not available and it was not retrieved."
-  (let ((path-relative (file-relative-name path)))
+  (let* ((default-directory (expand-file-name org-attach-directory))
+	 (path-relative (file-relative-name path)))
     (when (and (org-attach-use-annex)
     (when (and (org-attach-use-annex)
 	       (not
 	       (not
 		(string-equal
 		(string-equal