diff options
author | 2012-10-04 18:47:31 -0400 | |
---|---|---|
committer | 2012-10-04 18:47:31 -0400 | |
commit | 743c35709de77055a3e4947d673219569cd57fb4 (patch) | |
tree | 6133ddd1497576198df35ae66df27a9416129454 /Git/LsFiles.hs | |
parent | cedb6dc503441bfe54881ec646d86dd777635e7d (diff) |
more zombie fighting
I'm down to 9 places in the code that can produce unwaited for zombies.
Most of these are pretty innocuous, at least for now, are only
used in short-running commands, or commands that run a set of
actions and explicitly reap zombies after each one.
The one from Annex.Branch.files could be trouble later,
since both Command.Fsck and Command.Unused can trigger it,
and the assistant will be doing those eventally. Ditto the one in
Git.LsTree.lsTree, which Command.Unused uses.
The only ones currently affecting the assistant though, are
in Git.LsFiles. Several threads use several of those.
(And yeah, using pipes or ResourceT would be a less ad-hoc approach,
but I don't really feel like ripping my entire code base apart right
now to change a foundation monad. Maybe one of these days..)
Diffstat (limited to 'Git/LsFiles.hs')
-rw-r--r-- | Git/LsFiles.hs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Git/LsFiles.hs b/Git/LsFiles.hs index 321913334..51879fe13 100644 --- a/Git/LsFiles.hs +++ b/Git/LsFiles.hs @@ -26,11 +26,11 @@ import Git.Sha {- Scans for files that are checked into git at the specified locations. -} inRepo :: [FilePath] -> Repo -> IO [FilePath] -inRepo l = pipeNullSplit $ Params "ls-files --cached -z --" : map File l +inRepo l = pipeNullSplitZombie $ Params "ls-files --cached -z --" : map File l {- Scans for files at the specified locations that are not checked into git. -} notInRepo :: Bool -> [FilePath] -> Repo -> IO [FilePath] -notInRepo include_ignored l repo = pipeNullSplit params repo +notInRepo include_ignored l repo = pipeNullSplitZombie params repo where params = [Params "ls-files --others"] ++ exclude ++ [Params "-z --"] ++ map File l @@ -48,14 +48,14 @@ stagedNotDeleted :: [FilePath] -> Repo -> IO [FilePath] stagedNotDeleted = staged' [Param "--diff-filter=ACMRT"] staged' :: [CommandParam] -> [FilePath] -> Repo -> IO [FilePath] -staged' ps l = pipeNullSplit $ prefix ++ ps ++ suffix +staged' ps l = pipeNullSplitZombie $ prefix ++ ps ++ suffix where prefix = [Params "diff --cached --name-only -z"] suffix = Param "--" : map File l {- Returns a list of files that have unstaged changes. -} changedUnstaged :: [FilePath] -> Repo -> IO [FilePath] -changedUnstaged l = pipeNullSplit params +changedUnstaged l = pipeNullSplitZombie params where params = Params "diff --name-only -z --" : map File l @@ -71,7 +71,7 @@ typeChanged = typeChanged' [] typeChanged' :: [CommandParam] -> [FilePath] -> Repo -> IO [FilePath] typeChanged' ps l repo = do - fs <- pipeNullSplit (prefix ++ ps ++ suffix) repo + fs <- pipeNullSplitZombie (prefix ++ ps ++ suffix) repo -- git diff returns filenames relative to the top of the git repo; -- convert to filenames relative to the cwd, like git ls-files. let top = repoPath repo @@ -108,7 +108,8 @@ unmerged :: [FilePath] -> Repo -> IO [Unmerged] unmerged l repo = reduceUnmerged [] . catMaybes . map parseUnmerged <$> list repo where files = map File l - list = pipeNullSplit $ Params "ls-files --unmerged -z --" : files + list = pipeNullSplitZombie $ + Params "ls-files --unmerged -z --" : files data InternalUnmerged = InternalUnmerged { isus :: Bool |