diff options
Diffstat (limited to 'Annex/Content.hs')
-rw-r--r-- | Annex/Content.hs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Annex/Content.hs b/Annex/Content.hs index 9c71037de..f2d6e3249 100644 --- a/Annex/Content.hs +++ b/Annex/Content.hs @@ -124,7 +124,16 @@ inAnnexSafe key = inAnnex' (fromMaybe False) (Just False) go key Nothing -> is_unlocked check def Nothing = return def #else - checkindirect _ = return is_missing + checkindirect f = ifM (liftIO $ doesFileExist f) + ( do + v <- lockShared f + case v of + Nothing -> return is_locked + Just lockhandle -> do + dropLock lockhandle + return is_unlocked + , return is_missing + ) {- In Windows, see if we can take a shared lock. If so, - remove the lock file to clean up after ourselves. -} checkdirect contentfile lockfile = |