summaryrefslogtreecommitdiff
path: root/Remotes.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-11-18 13:48:28 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-11-18 13:49:01 -0400
commit161823d6eaff2adb7b99475b0edfe819fde11be1 (patch)
tree985788fced5af741d7da3b735876ba24e2b7f9d7 /Remotes.hs
parent54513c69baffa40f2fcce42eb8651fdd98e05277 (diff)
Only use cp -a if it is supported, falling back to cp -p or plain cp.
* cp --reflink=auto is used if supported, and will make git annex unlock much faster on filesystems like btrfs that support copy of write.
Diffstat (limited to 'Remotes.hs')
-rw-r--r--Remotes.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/Remotes.hs b/Remotes.hs
index 7aad6c2a0..bf5ede572 100644
--- a/Remotes.hs
+++ b/Remotes.hs
@@ -23,7 +23,7 @@ import Control.Monad.State (liftIO)
import Control.Monad (filterM)
import qualified Data.Map as Map
import Data.String.Utils
-import System.Directory
+import System.Directory hiding (copyFile)
import System.Posix.Directory
import List
import Monad (when, unless)
@@ -37,6 +37,7 @@ import UUID
import Utility
import qualified Core
import Messages
+import CopyFile
{- Human visible list of remotes. -}
list :: [Git.Repo] -> String
@@ -204,7 +205,7 @@ copyFromRemote r key file = do
then getssh
else error "copying from non-ssh repo not supported"
where
- getlocal = liftIO $ boolSystem "cp" ["-a", keyloc, file]
+ getlocal = liftIO $ copyFile keyloc file
getssh = scp r [sshLocation r keyloc, file]
keyloc = annexLocation r key
@@ -219,7 +220,7 @@ copyToRemote r key file = do
then putssh keyloc
else error "copying to non-ssh repo not supported"
where
- putlocal src = liftIO $ boolSystem "cp" ["-a", src, file]
+ putlocal src = liftIO $ copyFile src file
putssh src = scp r [src, sshLocation r file]
sshLocation :: Git.Repo -> FilePath -> FilePath