This commit is contained in:
Joey Hess 2014-06-05 15:31:23 -04:00
parent bbfe4eafd7
commit eb86f1338f
3 changed files with 13 additions and 1 deletions

View file

@ -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 =