fsck: Don't claim to fix direct mode when run on a symlink whose content is not present.

This commit is contained in:
Joey Hess 2013-07-08 17:29:42 -04:00
parent 6999815d91
commit c1307b1388
2 changed files with 12 additions and 11 deletions

View file

@ -189,9 +189,12 @@ toDirectGen k f = do
, do , do
{- Copy content from another direct file. -} {- Copy content from another direct file. -}
absf <- liftIO $ absPath f absf <- liftIO $ absPath f
locs <- filterM (\l -> isNothing <$> getAnnexLinkTarget l) =<< dlocs <- filterM (goodContent k) =<<
(filter (/= absf) <$> addAssociatedFile k f) filterM (\l -> isNothing <$> getAnnexLinkTarget l) =<<
return $ Just $ fromdirect locs (filter (/= absf) <$> addAssociatedFile k f)
case dlocs of
[] -> return Nothing
(dloc:_) -> return $ Just $ fromdirect dloc
) )
where where
fromindirect loc = do fromindirect loc = do
@ -201,14 +204,10 @@ toDirectGen k f = do
void $ addAssociatedFile k f void $ addAssociatedFile k f
thawContent loc thawContent loc
replaceFile f $ liftIO . moveFile loc replaceFile f $ liftIO . moveFile loc
fromdirect (loc:locs) = ifM (goodContent k loc) fromdirect loc = do
( do replaceFile f $
replaceFile f $ liftIO . void . copyFileExternal loc
liftIO . void . copyFileExternal loc updateInodeCache k f
updateInodeCache k f
, fromdirect locs
)
fromdirect [] = noop
{- Removes a direct mode file, while retaining its content in the annex {- Removes a direct mode file, while retaining its content in the annex
- (unless its content has already been changed). -} - (unless its content has already been changed). -}

2
debian/changelog vendored
View file

@ -30,6 +30,8 @@ git-annex (4.20130628) UNRELEASED; urgency=low
for encryption. for encryption.
* dropunused, addunused: Complain when asked to operate on a number that * dropunused, addunused: Complain when asked to operate on a number that
does not correspond to any unused key. does not correspond to any unused key.
* fsck: Don't claim to fix direct mode when run on a symlink whose content
is not present.
-- Joey Hess <joeyh@debian.org> Tue, 02 Jul 2013 15:40:55 -0400 -- Joey Hess <joeyh@debian.org> Tue, 02 Jul 2013 15:40:55 -0400