summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-01-19 16:14:40 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-01-19 16:14:40 -0400
commit71cb04bb6d7d787181f158cad15a67628b0b4402 (patch)
tree796730ab3b82ff42bfaa8ab85c9a481c3e8ac989
parent06b0cb6224377fd2ea86e4e209e94a502f92716e (diff)
optimize fsck --from directory special remote
No need to copy anything, just symlink to the file.
-rw-r--r--Remote/Directory.hs6
1 files 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 =