some more direct mode fixes
Avoid a crash if a mapping contains files that no longer exist. This could happen because eg, one was deleted and a commit has not yet been done to update the mapping. Fix path calculation.
This commit is contained in:
parent
5c58e9c101
commit
e481ca7658
1 changed files with 3 additions and 3 deletions
|
@ -172,8 +172,8 @@ toDirectGen :: Key -> FilePath -> Annex (Maybe (Annex ()))
|
|||
toDirectGen k f = do
|
||||
loc <- inRepo $ gitAnnexLocation k
|
||||
createContentDir loc -- thaws directory too
|
||||
top <- fromRepo Git.repoPath
|
||||
locs <- filter (/= normalise (top </> f)) <$> addAssociatedFile k f
|
||||
absf <- liftIO $ absPath f
|
||||
locs <- filter (/= absf) <$> addAssociatedFile k f
|
||||
case locs of
|
||||
[] -> ifM (liftIO $ doesFileExist loc)
|
||||
( return $ Just $ do
|
||||
|
@ -183,7 +183,7 @@ toDirectGen k f = do
|
|||
liftIO $ replaceFile f $ moveFile loc
|
||||
, return Nothing
|
||||
)
|
||||
(loc':_) -> ifM (liftIO $ not . isSymbolicLink <$> getSymbolicLinkStatus loc')
|
||||
(loc':_) -> ifM (liftIO $ catchBoolIO $ not . isSymbolicLink <$> getSymbolicLinkStatus loc')
|
||||
{- Another direct file has the content; copy it. -}
|
||||
( return $ Just $ do
|
||||
liftIO $ replaceFile f $
|
||||
|
|
Loading…
Add table
Reference in a new issue