index file recovery
This commit is contained in:
parent
5673fbbd72
commit
3e61749d08
6 changed files with 69 additions and 16 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue