more RawFilePath conversion

nukeFile replaced with removeWhenExistsWith removeLink, which allows
using RawFilePath. Utility.Directory cannot use RawFilePath since setup
does not depend on posix.

This commit was sponsored by Graham Spencer on Patreon.
This commit is contained in:
Joey Hess 2020-10-29 10:33:12 -04:00
parent 8d66f7ba0f
commit e505c03bcc
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
51 changed files with 182 additions and 153 deletions

View file

@ -176,7 +176,7 @@ resolveMerge' unstagedmap (Just us) them inoverlay u = do
-- files, so delete here.
unless inoverlay $
unless (islocked LsFiles.valUs) $
liftIO $ nukeFile file
liftIO $ removeWhenExistsWith removeLink file
| otherwise -> do
-- Only resolve using symlink when both
-- were locked, otherwise use unlocked
@ -309,7 +309,7 @@ cleanConflictCruft resolvedks resolvedfs unstagedmap = do
<$> mapM Database.Keys.getInodeCaches resolvedks
forM_ (M.toList unstagedmap) $ \(i, f) ->
whenM (matchesresolved is i f) $
liftIO $ nukeFile f
liftIO $ removeWhenExistsWith removeLink f
where
fs = S.fromList resolvedfs
ks = S.fromList resolvedks