I've attached a patch that fixes a minor issue in org-attach related to
git annex. Basically, it ensures that a shell command is called from
within the git-annex repository (i.e., the org-attach-directory).
Otherwise, the command results in an error because it is called in the
incorrect directory.

Best,
Matt

>From 6158eee0a36f41d90e78ae59df3cfac03f291157 Mon Sep 17 00:00:00 2001
From: Matt Lundin <m...@imapmail.org>
Date: Sun, 25 Mar 2018 22:11:09 -0500
Subject: [PATCH] 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.
---
 lisp/org-attach.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/org-attach.el b/lisp/org-attach.el
index fdf652822..192815f4f 100644
--- a/lisp/org-attach.el
+++ b/lisp/org-attach.el
@@ -320,7 +320,8 @@ the ATTACH_DIR property) their own attachment directory."
 (defun org-attach-annex-get-maybe (path)
   "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."
-  (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)
 	       (not
 		(string-equal
-- 
2.16.2

Reply via email to