add inAnnex check to local lockKey
authorJoey Hess <joeyh@joeyh.name>
Fri, 9 Oct 2015 22:00:37 +0000 (18:00 -0400)
committerJoey Hess <joeyh@joeyh.name>
Fri, 9 Oct 2015 22:00:37 +0000 (18:00 -0400)
Remote/Git.hs

index 80c0579cc41a11723e5f9215f26e538881e69afe..c80a0d1c614794c59534f9f5f1c21e345b5f0927 100644 (file)
@@ -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"