From 71cb04bb6d7d787181f158cad15a67628b0b4402 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 19 Jan 2012 16:14:40 -0400 Subject: optimize fsck --from directory special remote No need to copy anything, just symlink to the file. --- Remote/Directory.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Remote/Directory.hs b/Remote/Directory.hs index 9705d5843..5cdb89f33 100644 --- a/Remote/Directory.hs +++ b/Remote/Directory.hs @@ -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 = -- cgit v1.2.3