summaryrefslogtreecommitdiff
path: root/Git/UpdateIndex.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-10-22 12:58:04 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-10-22 12:58:04 -0400
commit034d6fec96f30c479f79a5826ef79b2414545b1f (patch)
tree3dad79d984dca06dd9cb60054b0ff08994e19652 /Git/UpdateIndex.hs
parente0f2ec01ceafb0ee3fdd68ef025e1ee31071b13a (diff)
index file recovery
Diffstat (limited to 'Git/UpdateIndex.hs')
-rw-r--r--Git/UpdateIndex.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/Git/UpdateIndex.hs b/Git/UpdateIndex.hs
index 5d07e2011..3b33ac846 100644
--- a/Git/UpdateIndex.hs
+++ b/Git/UpdateIndex.hs
@@ -13,6 +13,7 @@ module Git.UpdateIndex (
streamUpdateIndex,
lsTree,
updateIndexLine,
+ stageFile,
unstageFile,
stageSymlink
) where
@@ -61,6 +62,11 @@ updateIndexLine :: Sha -> BlobType -> TopFilePath -> String
updateIndexLine sha filetype file =
show filetype ++ " blob " ++ show sha ++ "\t" ++ indexPath file
+stageFile :: Sha -> BlobType -> FilePath -> Repo -> IO Streamer
+stageFile sha filetype file repo = do
+ p <- toTopFilePath file repo
+ return $ pureStreamer $ updateIndexLine sha filetype p
+
{- A streamer that removes a file from the index. -}
unstageFile :: FilePath -> Repo -> IO Streamer
unstageFile file repo = do