summaryrefslogtreecommitdiff
path: root/Git/LsFiles.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-12-12 13:25:26 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-12-12 13:25:26 -0400
commit153975db756137e64f42965fed89ae6e1be30277 (patch)
treef0f9280bd467a78215140782ca581d330f14d8ae /Git/LsFiles.hs
parentcf7b91b46d3520d9c522846e02a6cb2c01ba39eb (diff)
add notStaged
Diffstat (limited to 'Git/LsFiles.hs')
-rw-r--r--Git/LsFiles.hs9
1 files changed, 9 insertions, 0 deletions
diff --git a/Git/LsFiles.hs b/Git/LsFiles.hs
index fce9d44f4..e264dee8b 100644
--- a/Git/LsFiles.hs
+++ b/Git/LsFiles.hs
@@ -10,6 +10,7 @@ module Git.LsFiles (
notInRepo,
staged,
stagedNotDeleted,
+ notStaged,
typeChanged,
typeChangedStaged,
Conflicting(..),
@@ -52,6 +53,14 @@ staged' ps l = pipeNullSplit $ prefix ++ ps ++ suffix
prefix = [Params "diff --cached --name-only -z"]
suffix = Param "--" : map File l
+{- Returns a list of all files that have unstaged changes. This includes
+ - any new files, that have not been added yet. -}
+notStaged :: [FilePath] -> Repo -> IO ([FilePath], IO Bool)
+notStaged l repo = pipeNullSplit params repo
+ where
+ params = [Params "ls-files --others --deleted --modified --exclude-standard -z --"] ++
+ map File l
+
{- Returns a list of the files in the specified locations that are staged
- for commit, and whose type has changed. -}
typeChangedStaged :: [FilePath] -> Repo -> IO ([FilePath], IO Bool)