optimize fsck --from directory special remote

No need to copy anything, just symlink to the file.
This commit is contained in:
Joey Hess 2012-01-19 16:14:40 -04:00
parent 06b0cb6224
commit 71cb04bb6d

View file

@ -110,8 +110,10 @@ storeHelper d key a = do
return ok
retrieve :: FilePath -> Key -> Bool -> FilePath -> Annex Bool
retrieve d k _ f = do
liftIO $ withStoredFile d k $ \file -> copyFileExternal file f
retrieve d k tmp f = liftIO $ withStoredFile d k $ \file ->
if tmp
then catchBoolIO $ createSymbolicLink file f >> return True
else copyFileExternal file f
retrieveEncrypted :: FilePath -> (Cipher, Key) -> FilePath -> Annex Bool
retrieveEncrypted d (cipher, enck) f =