summaryrefslogtreecommitdiff
path: root/Git/CatFile.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-09-15 16:44:27 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-09-15 17:06:10 -0400
commite1baf48d8853a5015009fe822a125192bb952222 (patch)
tree78b9b51d5b8f0ebc7b4ec05e7bd955ffc608db77 /Git/CatFile.hs
parent87fb9c690e776852e8dc3fa2ba53a3e267f203d8 (diff)
add catFileIndex
Diffstat (limited to 'Git/CatFile.hs')
-rw-r--r--Git/CatFile.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/Git/CatFile.hs b/Git/CatFile.hs
index e667b2087..1481bb462 100644
--- a/Git/CatFile.hs
+++ b/Git/CatFile.hs
@@ -10,6 +10,7 @@ module Git.CatFile (
catFileStart,
catFileStop,
catFile,
+ catFileIndex,
catObject,
catObjectDetails,
) where
@@ -40,6 +41,10 @@ catFileStop = CoProcess.stop
catFile :: CatFileHandle -> Branch -> FilePath -> IO L.ByteString
catFile h branch file = catObject h $ Ref $ show branch ++ ":" ++ file
+{- Reads a file from the index. -}
+catFileIndex :: CatFileHandle -> FilePath -> IO L.ByteString
+catFileIndex h file = catObject h $ Ref $ ':' : file
+
{- Uses a running git cat-file read the content of an object.
- Objects that do not exist will have "" returned. -}
catObject :: CatFileHandle -> Ref -> IO L.ByteString