diff options
author | 2015-06-01 13:52:23 -0400 | |
---|---|---|
committer | 2015-06-01 13:52:23 -0400 | |
commit | 39c13f91004b41166b786785083e78b34df0c48f (patch) | |
tree | bf5ea0acf27c9075a63d3b23b970c3ea44ecee64 /Remote/Bup.hs | |
parent | 3a9ca30fa8740a57ea477243498339f9738102d6 (diff) |
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.
Diffstat (limited to 'Remote/Bup.hs')
-rw-r--r-- | Remote/Bup.hs | 8 |
1 files changed, 5 insertions, 3 deletions
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 |