From 153975db756137e64f42965fed89ae6e1be30277 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 12 Dec 2012 13:25:26 -0400 Subject: add notStaged --- Git/LsFiles.hs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Git') 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) -- cgit v1.2.3