summaryrefslogtreecommitdiff
path: root/Remote/Git.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-10-09 13:35:28 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-10-09 13:35:28 -0400
commitcdc18dea255090d0eb9c1dcd9ffa433665736b18 (patch)
treefff464beb7a3313e963de128f37f43db490a49ef /Remote/Git.hs
parent8817fe6331ffc3d99bbf44af559f773af1a2ddd2 (diff)
fix lockKey to run callback in original Annex monad, not local remote's
Diffstat (limited to 'Remote/Git.hs')
-rw-r--r--Remote/Git.hs11
1 files changed, 8 insertions, 3 deletions
diff --git a/Remote/Git.hs b/Remote/Git.hs
index 9fa7158e5..5c429c93c 100644
--- a/Remote/Git.hs
+++ b/Remote/Git.hs
@@ -361,10 +361,15 @@ dropKey r key
| otherwise = commitOnCleanup r $ Ssh.dropKey (repo r) key
lockKey :: Remote -> Key -> (VerifiedCopy -> Annex r) -> Annex r
-lockKey r key a
+lockKey r key callback
| not $ Git.repoIsUrl (repo r) =
- guardUsable (repo r) cantlock $
- onLocal r $ Annex.Content.lockContentShared key a
+ guardUsable (repo r) cantlock $ do
+ inorigrepo <- Annex.makeRunner
+ -- 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
| Git.repoIsHttp (repo r) = cantlock
| otherwise = error "TODO"
where