diff options
author | Joey Hess <joey@kitenet.net> | 2011-12-15 18:11:42 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-12-15 18:19:36 -0400 |
commit | 95d2391f58ae240e7100f0d5488dd7246f71f3bb (patch) | |
tree | f33f21904ae7be4d40b70bab1e2a68fd4eef5526 /Remote/Bup.hs | |
parent | b7e0d39abbc9a09c21c6f0103ad6c9f4547f81fe (diff) |
more partial function removal
Left a few Prelude.head's in where it was checked not null and too hard to
remove, etc.
Diffstat (limited to 'Remote/Bup.hs')
-rw-r--r-- | Remote/Bup.hs | 8 |
1 files changed, 4 insertions, 4 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 |