summaryrefslogtreecommitdiff
path: root/Remote
diff options
context:
space:
mode:
Diffstat (limited to 'Remote')
-rw-r--r--Remote/Bup.hs8
-rw-r--r--Remote/Directory.hs2
-rw-r--r--Remote/Rsync.hs2
3 files changed, 6 insertions, 6 deletions
diff --git a/Remote/Bup.hs b/Remote/Bup.hs
index 8bd484b7d..cbd5d584a 100644
--- a/Remote/Bup.hs
+++ b/Remote/Bup.hs
@@ -209,20 +209,20 @@ bup2GitRemote "" = do
Git.Construct.fromAbsPath $ h </> ".bup"
bup2GitRemote r
| bupLocal r =
- if head r == '/'
+ if "/" `isPrefixOf` r
then Git.Construct.fromAbsPath r
else error "please specify an absolute path"
| otherwise = Git.Construct.fromUrl $ "ssh://" ++ host ++ slash dir
where
bits = split ":" r
- host = head bits
+ host = Prelude.head bits
dir = join ":" $ drop 1 bits
-- "host:~user/dir" is not supported specially by bup;
-- "host:dir" is relative to the home directory;
-- "host:" goes in ~/.bup
slash d
- | d == "" = "/~/.bup"
- | head d == '/' = d
+ | null d = "/~/.bup"
+ | "/" `isPrefixOf` d = d
| otherwise = "/~/" ++ d
bupLocal :: BupRepo -> Bool
diff --git a/Remote/Directory.hs b/Remote/Directory.hs
index a6077d813..7f78b2f49 100644
--- a/Remote/Directory.hs
+++ b/Remote/Directory.hs
@@ -96,7 +96,7 @@ storeEncrypted d (cipher, enck) k = do
storeHelper :: FilePath -> Key -> (FilePath -> IO Bool) -> IO Bool
storeHelper d key a = do
- let dest = head $ locations d key
+ let dest = Prelude.head $ locations d key
let dir = parentDir dest
createDirectoryIfMissing True dir
allowWrite dir
diff --git a/Remote/Rsync.hs b/Remote/Rsync.hs
index 81107cb56..c28142077 100644
--- a/Remote/Rsync.hs
+++ b/Remote/Rsync.hs
@@ -188,7 +188,7 @@ rsyncRemote o params = do
directories. -}
rsyncSend :: RsyncOpts -> Key -> FilePath -> Annex Bool
rsyncSend o k src = withRsyncScratchDir $ \tmp -> do
- let dest = tmp </> head (keyPaths k)
+ let dest = tmp </> Prelude.head (keyPaths k)
liftIO $ createDirectoryIfMissing True $ parentDir dest
liftIO $ createLink src dest
rsyncRemote o