aboutsummaryrefslogtreecommitdiff
path: root/Git/LsFiles.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-10-23 12:58:01 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-10-23 13:00:45 -0400
commitb77b0848ee28093b63e3ab0d1ea494e430ffe58b (patch)
tree7bcc235a07319bb4461373b5d0656ddc90aad357 /Git/LsFiles.hs
parentfb2ccfd60ff09c1b1d03838d42eba3c65fd7fb27 (diff)
repair command: add handling of git-annex branch and index
Diffstat (limited to 'Git/LsFiles.hs')
-rw-r--r--Git/LsFiles.hs9
1 files changed, 6 insertions, 3 deletions
diff --git a/Git/LsFiles.hs b/Git/LsFiles.hs
index d58fe162b..98cbac58e 100644
--- a/Git/LsFiles.hs
+++ b/Git/LsFiles.hs
@@ -20,6 +20,7 @@ module Git.LsFiles (
Conflicting(..),
Unmerged(..),
unmerged,
+ StagedDetails,
) where
import Common
@@ -79,18 +80,20 @@ staged' ps l = pipeNullSplit $ prefix ++ ps ++ suffix
prefix = [Params "diff --cached --name-only -z"]
suffix = Param "--" : map File l
+type StagedDetails = (FilePath, Maybe Sha, Maybe FileMode)
+
{- Returns details about files that are staged in the index,
- as well as files not yet in git. Skips ignored files. -}
-stagedOthersDetails :: [FilePath] -> Repo -> IO ([(FilePath, Maybe Sha, Maybe FileMode)], IO Bool)
+stagedOthersDetails :: [FilePath] -> Repo -> IO ([StagedDetails], IO Bool)
stagedOthersDetails = stagedDetails' [Params "--others --exclude-standard"]
{- Returns details about all files that are staged in the index. -}
-stagedDetails :: [FilePath] -> Repo -> IO ([(FilePath, Maybe Sha, Maybe FileMode)], IO Bool)
+stagedDetails :: [FilePath] -> Repo -> IO ([StagedDetails], IO Bool)
stagedDetails = stagedDetails' []
{- Gets details about staged files, including the Sha of their staged
- contents. -}
-stagedDetails' :: [CommandParam] -> [FilePath] -> Repo -> IO ([(FilePath, Maybe Sha, Maybe FileMode)], IO Bool)
+stagedDetails' :: [CommandParam] -> [FilePath] -> Repo -> IO ([StagedDetails], IO Bool)
stagedDetails' ps l repo = do
(ls, cleanup) <- pipeNullSplit params repo
return (map parse ls, cleanup)