summaryrefslogtreecommitdiff
path: root/GitRepo.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-06-29 11:55:16 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-06-29 11:55:16 -0400
commit06a1f5f74286795708b219de8fb080077ff134a7 (patch)
treecfdb751f3ae77c307e8da1268ff55b9d887212e4 /GitRepo.hs
parentaf45d422248846869babdbc3eae2765d94ea9f20 (diff)
factor out file list stuff from GitRepo
GitRepo is getting too large an interface; these all fit nicely into a submodule.
Diffstat (limited to 'GitRepo.hs')
-rw-r--r--GitRepo.hs56
1 files changed, 0 insertions, 56 deletions
diff --git a/GitRepo.hs b/GitRepo.hs
index cfe949d5e..cc4636868 100644
--- a/GitRepo.hs
+++ b/GitRepo.hs
@@ -47,16 +47,9 @@ module GitRepo (
remotesAdd,
repoRemoteName,
repoRemoteNameSet,
- inRepo,
- notInRepo,
- stagedFiles,
- stagedFilesNotDeleted,
- changedUnstagedFiles,
checkAttr,
decodeGitFile,
encodeGitFile,
- typeChangedFiles,
- typeChangedStagedFiles,
repoAbsPath,
reap,
useIndex,
@@ -432,55 +425,6 @@ getSha subcommand a = do
shaSize :: Int
shaSize = 40
-{- Scans for files that are checked into git at the specified locations. -}
-inRepo :: Repo -> [FilePath] -> IO [FilePath]
-inRepo repo l = pipeNullSplit repo $
- [Params "ls-files --cached -z --"] ++ map File l
-
-{- Scans for files at the specified locations that are not checked into
- - git. -}
-notInRepo :: Repo -> Bool -> [FilePath] -> IO [FilePath]
-notInRepo repo include_ignored l =
- pipeNullSplit repo $ [Params "ls-files --others"]++exclude++[Params "-z --"] ++ map File l
- where
- exclude = if include_ignored then [] else [Param "--exclude-standard"]
-
-{- Returns a list of all files that are staged for commit. -}
-stagedFiles :: Repo -> [FilePath] -> IO [FilePath]
-stagedFiles repo l = stagedFiles' repo l []
-
-{- Returns a list of the files, staged for commit, that are being added,
- - moved, or changed (but not deleted), from the specified locations. -}
-stagedFilesNotDeleted :: Repo -> [FilePath] -> IO [FilePath]
-stagedFilesNotDeleted repo l = stagedFiles' repo l [Param "--diff-filter=ACMRT"]
-
-stagedFiles' :: Repo -> [FilePath] -> [CommandParam] -> IO [FilePath]
-stagedFiles' repo l middle = pipeNullSplit repo $ start ++ middle ++ end
- where
- start = [Params "diff --cached --name-only -z"]
- end = [Param "--"] ++ map File l
-
-{- Returns a list of files that have unstaged changes. -}
-changedUnstagedFiles :: Repo -> [FilePath] -> IO [FilePath]
-changedUnstagedFiles repo l = pipeNullSplit repo $
- [Params "diff --name-only -z --"] ++ map File l
-
-{- Returns a list of the files in the specified locations that are staged
- - for commit, and whose type has changed. -}
-typeChangedStagedFiles :: Repo -> [FilePath] -> IO [FilePath]
-typeChangedStagedFiles repo l = typeChangedFiles' repo l [Param "--cached"]
-
-{- Returns a list of the files in the specified locations whose type has
- - changed. Files only staged for commit will not be included. -}
-typeChangedFiles :: Repo -> [FilePath] -> IO [FilePath]
-typeChangedFiles repo l = typeChangedFiles' repo l []
-
-typeChangedFiles' :: Repo -> [FilePath] -> [CommandParam] -> IO [FilePath]
-typeChangedFiles' repo l middle = pipeNullSplit repo $ start ++ middle ++ end
- where
- start = [Params "diff --name-only --diff-filter=T -z"]
- end = [Param "--"] ++ map File l
-
{- Reads null terminated output of a git command (as enabled by the -z
- parameter), and splits it into a list of files/lines/whatever. -}
pipeNullSplit :: Repo -> [CommandParam] -> IO [FilePath]