diff options
author | Joey Hess <joey@kitenet.net> | 2013-07-08 17:29:42 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-07-08 17:29:42 -0400 |
commit | 2baf3b83b021e3b162fdc75b03e38f8b070a9b4a (patch) | |
tree | 8aa1635e289a34d5e257e9add36717d36cae374b | |
parent | 1a4ada4f2f008bf836eb9b72bfaaaf54485ab9d2 (diff) |
fsck: Don't claim to fix direct mode when run on a symlink whose content is not present.
-rw-r--r-- | Annex/Direct.hs | 21 | ||||
-rw-r--r-- | debian/changelog | 2 |
2 files changed, 12 insertions, 11 deletions
diff --git a/Annex/Direct.hs b/Annex/Direct.hs index c958ac287..cf5806ad6 100644 --- a/Annex/Direct.hs +++ b/Annex/Direct.hs @@ -189,9 +189,12 @@ toDirectGen k f = do , do {- Copy content from another direct file. -} absf <- liftIO $ absPath f - locs <- filterM (\l -> isNothing <$> getAnnexLinkTarget l) =<< - (filter (/= absf) <$> addAssociatedFile k f) - return $ Just $ fromdirect locs + dlocs <- filterM (goodContent k) =<< + filterM (\l -> isNothing <$> getAnnexLinkTarget l) =<< + (filter (/= absf) <$> addAssociatedFile k f) + case dlocs of + [] -> return Nothing + (dloc:_) -> return $ Just $ fromdirect dloc ) where fromindirect loc = do @@ -201,14 +204,10 @@ toDirectGen k f = do void $ addAssociatedFile k f thawContent loc replaceFile f $ liftIO . moveFile loc - fromdirect (loc:locs) = ifM (goodContent k loc) - ( do - replaceFile f $ - liftIO . void . copyFileExternal loc - updateInodeCache k f - , fromdirect locs - ) - fromdirect [] = noop + fromdirect loc = do + replaceFile f $ + liftIO . void . copyFileExternal loc + updateInodeCache k f {- Removes a direct mode file, while retaining its content in the annex - (unless its content has already been changed). -} diff --git a/debian/changelog b/debian/changelog index 46ba94370..dec7bed0a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -30,6 +30,8 @@ git-annex (4.20130628) UNRELEASED; urgency=low for encryption. * dropunused, addunused: Complain when asked to operate on a number that 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 |