convert parentDir to be based on takeDirectory, but fixed for trailing /

This commit is contained in:
Joey Hess 2015-01-09 14:26:52 -04:00
parent 3bab5dfb1d
commit f4de021a54
4 changed files with 22 additions and 24 deletions

View file

@ -308,10 +308,10 @@ preserveUnannexed item makeabs absf oldref = do
liftIO $ findnewname absf 0
checkdirs (DiffTree.file item)
where
checkdirs from = do
let p = parentDir (getTopFilePath from)
let d = asTopFilePath p
unless (null p) $ do
checkdirs from = case upFrom (getTopFilePath from) of
Nothing -> noop
Just p -> do
let d = asTopFilePath p
let absd = makeabs d
whenM (liftIO (colliding_nondir absd) <&&> unannexed absd) $
liftIO $ findnewname absd 0