use Common in a few more modules

This commit is contained in:
Joey Hess 2011-12-20 14:37:53 -04:00
parent 6897460d35
commit ee3b5b2a42
8 changed files with 30 additions and 31 deletions

View file

@ -15,9 +15,9 @@ module Git.LsFiles (
typeChangedStaged,
) where
import Common
import Git
import Git.Command
import Utility.SafeCommand
{- Scans for files that are checked into git at the specified locations. -}
inRepo :: [FilePath] -> Repo -> IO [FilePath]
@ -43,10 +43,10 @@ stagedNotDeleted :: [FilePath] -> Repo -> IO [FilePath]
stagedNotDeleted = staged' [Param "--diff-filter=ACMRT"]
staged' :: [CommandParam] -> [FilePath] -> Repo -> IO [FilePath]
staged' middle l = pipeNullSplit $ start ++ middle ++ end
staged' ps l = pipeNullSplit $ prefix ++ ps ++ suffix
where
start = [Params "diff --cached --name-only -z"]
end = Param "--" : map File l
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]
@ -65,7 +65,7 @@ typeChanged :: [FilePath] -> Repo -> IO [FilePath]
typeChanged = typeChanged' []
typeChanged' :: [CommandParam] -> [FilePath] -> Repo -> IO [FilePath]
typeChanged' middle l = pipeNullSplit $ start ++ middle ++ end
typeChanged' ps l = pipeNullSplit $ prefix ++ ps ++ suffix
where
start = [Params "diff --name-only --diff-filter=T -z"]
end = Param "--" : map File l
prefix = [Params "diff --name-only --diff-filter=T -z"]
suffix = Param "--" : map File l