aboutsummaryrefslogtreecommitdiff
path: root/Annex/CatFile.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-12-12 19:20:38 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-12-12 19:20:38 -0400
commit3e55a8f164d67d5bd1ef86ae2f38fb2c6c3a51b2 (patch)
treea3115943cd1b5a86f9419a8042f469655234937a /Annex/CatFile.hs
parentdb6cbec803a17d8e7eebdd3443713b8ea6ddb091 (diff)
direct mode committing
Diffstat (limited to 'Annex/CatFile.hs')
-rw-r--r--Annex/CatFile.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/Annex/CatFile.hs b/Annex/CatFile.hs
index 88c498d31..cde9d5170 100644
--- a/Annex/CatFile.hs
+++ b/Annex/CatFile.hs
@@ -9,6 +9,7 @@ module Annex.CatFile (
catFile,
catObject,
catObjectDetails,
+ catKey,
catFileHandle
) where
@@ -42,3 +43,7 @@ catFileHandle = maybe startup return =<< Annex.getState Annex.catfilehandle
h <- inRepo Git.CatFile.catFileStart
Annex.changeState $ \s -> s { Annex.catfilehandle = Just h }
return h
+
+{- From the Sha of a symlink back to the key. -}
+catKey :: Sha -> Annex (Maybe Key)
+catKey sha = fileKey . takeFileName . encodeW8 . L.unpack <$> catObject sha