From 30e0065ab97843f866a7fe095b8a18ee6eb4c321 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 31 Dec 2010 15:52:59 -0400 Subject: [PATCH] tuple makes it clearer --- Command/Move.hs | 2 +- Remotes.hs | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Command/Move.hs b/Command/Move.hs index 4291d221a0..d96d36138c 100644 --- a/Command/Move.hs +++ b/Command/Move.hs @@ -136,7 +136,7 @@ fromPerform move key = do else return Nothing -- fail fromCleanup :: Bool -> Git.Repo -> Key -> CommandCleanup fromCleanup True remote key = do - ok <- Remotes.onRemote remote boolSystem False "dropkey" + ok <- Remotes.onRemote remote (boolSystem, False) "dropkey" ["--quiet", "--force", "--backend=" ++ backendName key, keyName key] diff --git a/Remotes.hs b/Remotes.hs index 841fe947fe..70356de024 100644 --- a/Remotes.hs +++ b/Remotes.hs @@ -119,7 +119,7 @@ inAnnex r key = if Git.repoIsUrl r Annex.eval a (Core.inAnnex key) checkremote = do showNote ("checking " ++ Git.repoDescribe r ++ "...") - inannex <- onRemote r boolSystem False "inannex" + inannex <- onRemote r (boolSystem, False) "inannex" ["--backend=" ++ backendName key, keyName key] return $ Right inannex @@ -200,7 +200,7 @@ byName name = do tryGitConfigRead :: Git.Repo -> Annex (Either Git.Repo Git.Repo) tryGitConfigRead r | not $ Map.null $ Git.configMap r = return $ Right r -- already read - | Git.repoIsSsh r = store $ onRemote r pipedconfig r "configlist" [] + | Git.repoIsSsh r = store $ onRemote r (pipedconfig, r) "configlist" [] | Git.repoIsUrl r = return $ Left r | otherwise = store $ safely $ Git.configRead r where @@ -275,12 +275,11 @@ remoteCopyFile recv r src dest = do {- Uses a supplied function to run a git-annex-shell command on a remote. -} onRemote :: Git.Repo - -> (String -> [String] -> IO a) - -> a + -> ((String -> [String] -> IO a), a) -> String -> [String] -> Annex a -onRemote r with errorval command params +onRemote r (with, errorval) command params | not $ Git.repoIsUrl r = liftIO $ with shellcmd shellopts | Git.repoIsSsh r = do sshoptions <- repoConfig r "ssh-options" ""