aboutsummaryrefslogtreecommitdiff
path: root/Remote/Bup.hs
diff options
context:
space:
mode:
authorGravatar Oliver Matthews <oliver@codersoffortune.net>2013-06-21 09:28:43 +0100
committerGravatar Oliver Matthews <oliver@codersoffortune.net>2013-06-21 09:28:43 +0100
commitae79041846c0810d7bf8e12241b365665d8744bc (patch)
tree0091ac01b495ef6576eed684f92acaadc038833c /Remote/Bup.hs
parentf779dd43ec93e05ca1c1ab397a6dc2f0ea831642 (diff)
Strip leading /~/ from bup relatively pathed bup remotes
Diffstat (limited to 'Remote/Bup.hs')
-rw-r--r--Remote/Bup.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/Remote/Bup.hs b/Remote/Bup.hs
index f5c802e09..9b3675cfa 100644
--- a/Remote/Bup.hs
+++ b/Remote/Bup.hs
@@ -217,10 +217,13 @@ storeBupUUID u buprepo = do
onBupRemote :: Git.Repo -> (FilePath -> [CommandParam] -> IO a) -> FilePath -> [CommandParam] -> Annex a
onBupRemote r a command params = do
- let dir = shellEscape (Git.repoPath r)
sshparams <- sshToRepo r [Param $
"cd " ++ dir ++ " && " ++ unwords (command : toCommand params)]
liftIO $ a "ssh" sshparams
+ where
+ path = Git.repoPath r
+ base = fromMaybe path (stripPrefix "/~/" path)
+ dir = shellEscape base
{- Allow for bup repositories on removable media by checking
- local bup repositories to see if they are available, and getting their