aboutsummaryrefslogtreecommitdiff
path: root/Remote/Git.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-10-09 18:00:37 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-10-09 18:00:37 -0400
commitbef58852d9b6150b0e2a47c412bd12dcc34a7794 (patch)
treed1cfee926eb3a92036c7b7be370bbfeeced7ad4f /Remote/Git.hs
parent7ab25bf78b0ecfe391274b721229459ac58be14f (diff)
add inAnnex check to local lockKey
Diffstat (limited to 'Remote/Git.hs')
-rw-r--r--Remote/Git.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/Remote/Git.hs b/Remote/Git.hs
index 80c0579cc..c80a0d1c6 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"