From 39c13f91004b41166b786785083e78b34df0c48f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 1 Jun 2015 13:52:23 -0400 Subject: remove Params constructor from Utility.SafeCommand This removes a bit of complexity, and should make things faster (avoids tokenizing Params string), and probably involve less garbage collection. In a few places, it was useful to use Params to avoid needing a list, but that is easily avoided. Problems noticed while doing this conversion: * Some uses of Params "oneword" which was entirely unnecessary overhead. * A few places that built up a list of parameters with ++ and then used Params to split it! Test suite passes. --- Remote/Bup.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'Remote/Bup.hs') diff --git a/Remote/Bup.hs b/Remote/Bup.hs index b3152afcf..0c156345e 100644 --- a/Remote/Bup.hs +++ b/Remote/Bup.hs @@ -167,7 +167,7 @@ remove buprepo k = do | otherwise = void $ liftIO $ catchMaybeIO $ do r' <- Git.Config.read r boolSystem "git" $ Git.Command.gitCommandLine params r' - params = [ Params "branch -q -D", Param (bupRef k) ] + params = [ Param "branch", Param "-q", Param "-D", Param (bupRef k) ] {- Bup does not provide a way to tell if a given dataset is present - in a bup repository. One way it to check if the git repository has @@ -182,7 +182,9 @@ checkKey r bupr k Git.Command.gitCommandLine params bupr where params = - [ Params "show-ref --quiet --verify" + [ Param "show-ref" + , Param "--quiet" + , Param "--verify" , Param $ "refs/heads/" ++ bupRef k ] @@ -194,7 +196,7 @@ storeBupUUID u buprepo = do then do showAction "storing uuid" unlessM (onBupRemote r boolSystem "git" - [Params $ "config annex.uuid " ++ v]) $ + [Param "config", Param "annex.uuid", Param v]) $ error "ssh failed" else liftIO $ do r' <- Git.Config.read r -- cgit v1.2.3