summaryrefslogtreecommitdiff
path: root/Remote/Git.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Remote/Git.hs')
-rw-r--r--Remote/Git.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/Remote/Git.hs b/Remote/Git.hs
index 5416a5cda..db5b2fbd0 100644
--- a/Remote/Git.hs
+++ b/Remote/Git.hs
@@ -51,6 +51,7 @@ import qualified Remote.Helper.Ssh as Ssh
import qualified Remote.GCrypt
import Config.Files
import Creds
+import Annex.CatFile
import Control.Concurrent
import Control.Concurrent.MSampleVar
@@ -500,6 +501,8 @@ repairRemote r a = return $ do
{- Runs an action from the perspective of a local remote.
-
- The AnnexState is cached for speed and to avoid resource leaks.
+ - However, catFileStop is called to avoid git-cat-file processes hanging
+ - around on removable media.
-
- The repository's git-annex branch is not updated, as an optimisation.
- No caller of onLocal can query data from the branch and be ensured
@@ -520,7 +523,8 @@ onLocal r a = do
cache st = Annex.changeState $ \s -> s
{ Annex.remoteannexstate = M.insert (uuid r) st (Annex.remoteannexstate s) }
go st a' = do
- (ret, st') <- liftIO $ Annex.run st a'
+ (ret, st') <- liftIO $ Annex.run st $
+ catFileStop `after` a'
cache st'
return ret