summaryrefslogtreecommitdiff
path: root/Annex.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-10-11 17:19:55 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-10-11 17:19:55 -0400
commitaf82586adff96f18fe768e432f501c647401262f (patch)
tree20e7ec170661ab11010e39ce46657b69e7341e09 /Annex.hs
parentde3dafae80f45af8db56dc95e11863f049cf3cb2 (diff)
split up Types
Diffstat (limited to 'Annex.hs')
-rw-r--r--Annex.hs19
1 files changed, 18 insertions, 1 deletions
diff --git a/Annex.hs b/Annex.hs
index e3956cbf2..cedc478a4 100644
--- a/Annex.hs
+++ b/Annex.hs
@@ -8,11 +8,28 @@ import System.Directory
import GitRepo
import Utility
import Locations
-import Types
import Backend
import BackendList
import LocationLog
+-- git-annex's runtime state
+data State = State {
+ repo :: GitRepo,
+ gitconfig :: GitConfig
+}
+
+data GitConfig = GitConfig {
+ annex_name :: String,
+ annex_numcopies :: Int,
+ annex_backends :: [Backend]
+}
+
+{- An annexed file's content is stored somewhere under .git/annex/ -}
+annexDir :: GitRepo -> Key -> IO FilePath
+annexDir repo key = do
+ dir <- gitDir repo
+ return $ dir ++ "/annex/" ++ key
+
{- On startup, examine the git repo, prepare it, and record state for
- later. -}
startAnnex :: IO State