status: Pass --ignore-submodules=when option on to git status.

Didn't make --ignore-submodules without a value be handled because I can't
see a way to make optparse-applicative parse that. I've opened a bug
requesting a way to do that:
https://github.com/pcapriotti/optparse-applicative/issues/243
This commit is contained in:
Joey Hess 2017-02-20 16:37:04 -04:00
parent a53daff32c
commit 75a15e1ad7
No known key found for this signature in database
GPG key ID: C910D9222512E3C7
4 changed files with 39 additions and 14 deletions

View file

@ -64,13 +64,14 @@ parseStatusZ = go []
cparse '?' = Just Untracked
cparse _ = Nothing
getStatus :: [FilePath] -> Repo -> IO ([Status], IO Bool)
getStatus l r = do
(ls, cleanup) <- pipeNullSplit params r
getStatus :: [CommandParam] -> [FilePath] -> Repo -> IO ([Status], IO Bool)
getStatus ps fs r = do
(ls, cleanup) <- pipeNullSplit ps' r
return (parseStatusZ ls, cleanup)
where
params =
[ Param "status"
, Param "-uall"
, Param "-z"
] ++ map File l
ps' = concat
[ [Param "status"]
, ps
, [ Param "-uall" , Param "-z"]
, map File fs
]