add: display exception when lockdown fails (for RichiH)
This commit is contained in:
parent
060dfe4faa
commit
9aa31b71f3
1 changed files with 7 additions and 4 deletions
|
@ -93,12 +93,15 @@ start file = ifAnnexed file addpresent add
|
||||||
- Lockdown can fail if a file gets deleted, and Nothing will be returned.
|
- Lockdown can fail if a file gets deleted, and Nothing will be returned.
|
||||||
-}
|
-}
|
||||||
lockDown :: FilePath -> Annex (Maybe KeySource)
|
lockDown :: FilePath -> Annex (Maybe KeySource)
|
||||||
lockDown file = ifM crippledFileSystem
|
lockDown = either (\e -> showErr e >> return Nothing) (return . Just) <=< lockDown'
|
||||||
( liftIO $ catchMaybeIO nohardlink
|
|
||||||
, do
|
lockDown' :: FilePath -> Annex (Either IOException KeySource)
|
||||||
|
lockDown' file = ifM crippledFileSystem
|
||||||
|
( liftIO $ tryIO nohardlink
|
||||||
|
, tryAnnexIO $ do
|
||||||
tmp <- fromRepo gitAnnexTmpMiscDir
|
tmp <- fromRepo gitAnnexTmpMiscDir
|
||||||
createAnnexDirectory tmp
|
createAnnexDirectory tmp
|
||||||
eitherToMaybe <$> tryAnnexIO (go tmp)
|
go tmp
|
||||||
)
|
)
|
||||||
where
|
where
|
||||||
{- In indirect mode, the write bit is removed from the file as part
|
{- In indirect mode, the write bit is removed from the file as part
|
||||||
|
|
Loading…
Reference in a new issue