summaryrefslogtreecommitdiff
path: root/Annex/CatFile.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Annex/CatFile.hs')
-rw-r--r--Annex/CatFile.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/Annex/CatFile.hs b/Annex/CatFile.hs
index bcf44551e..afb14c67f 100644
--- a/Annex/CatFile.hs
+++ b/Annex/CatFile.hs
@@ -8,6 +8,7 @@
module Annex.CatFile (
catFile,
catObject,
+ catObjectDetails,
catFileHandle
) where
@@ -17,6 +18,7 @@ import Common.Annex
import qualified Git
import qualified Git.CatFile
import qualified Annex
+import Git.Types
catFile :: Git.Branch -> FilePath -> Annex L.ByteString
catFile branch file = do
@@ -28,6 +30,11 @@ catObject ref = do
h <- catFileHandle
liftIO $ Git.CatFile.catObject h ref
+catObjectDetails :: Git.Ref -> Annex (Maybe (L.ByteString, Sha))
+catObjectDetails ref = do
+ h <- catFileHandle
+ liftIO $ Git.CatFile.catObjectDetails h ref
+
catFileHandle :: Annex Git.CatFile.CatFileHandle
catFileHandle = maybe startup return =<< Annex.getState Annex.catfilehandle
where