git subcommand cleanup

Pass subcommand as a regular param, which allows passing git parameters
like -c before it. This was already done in the pipeing set of functions,
but not the command running set.
This commit is contained in:
Joey Hess 2013-03-03 13:39:07 -04:00
parent 3a783b4a3a
commit 0c13d3065e
20 changed files with 95 additions and 76 deletions

View file

@ -73,8 +73,7 @@ fastForward branch (first:rest) repo =
where
no_ff = return False
do_ff to = do
run "update-ref"
[Param $ show branch, Param $ show to] repo
run [Param "update-ref", Param $ show branch, Param $ show to] repo
return True
findbest c [] = return $ Just c
findbest c (r:rs)
@ -97,7 +96,7 @@ commit message branch parentrefs repo = do
sha <- getSha "commit-tree" $ pipeWriteRead
(map Param $ ["commit-tree", show tree] ++ ps)
message repo
run "update-ref" [Param $ show branch, Param $ show sha] repo
run [Param "update-ref", Param $ show branch, Param $ show sha] repo
return sha
where
ps = concatMap (\r -> ["-p", show r]) parentrefs