From 2154b7a38f621d45ff31503c53c67c4f1a1a3d09 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 9 Oct 2015 18:00:37 -0400 Subject: [PATCH] add inAnnex check to local lockKey --- Remote/Git.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Remote/Git.hs b/Remote/Git.hs index 80c0579cc4..c80a0d1c61 100644 --- a/Remote/Git.hs +++ b/Remote/Git.hs @@ -369,8 +369,12 @@ lockKey r key callback -- Lock content from perspective of remote, -- and then run the callback in the original -- annex monad, not the remote's. - onLocal r $ Annex.Content.lockContentShared key $ - liftIO . inorigrepo . callback + onLocal r $ + Annex.Content.lockContentShared key $ \vc -> + ifM (Annex.Content.inAnnex key) + ( liftIO $ inorigrepo $ callback vc + , failedlock + ) | Git.repoIsSsh (repo r) = do showLocking r Just (cmd, params) <- Ssh.git_annex_shell (repo r) "lockcontent"