convert GitRepo to struct with constructor

This commit is contained in:
Joey Hess 2010-10-10 15:54:02 -04:00
parent 7880dc16fe
commit dce9c2e080
7 changed files with 71 additions and 50 deletions

18
Locations.hs Normal file
View file

@ -0,0 +1,18 @@
{- git-annex file locations
-}
module Locations where
import GitRepo
{- An annexed file's content is stored somewhere under .git/annex/ -}
annexDir :: GitRepo -> String -> IO FilePath
annexDir repo key = do
dir <- gitDir repo
return $ dir ++ "/annex/" ++ key
{- Long-term state is stored in files inside the .git-annex directory
- in the git repository. -}
stateLoc = ".git-annex"
gitStateDir :: GitRepo -> FilePath
gitStateDir repo = (top repo) ++ "/" ++ stateLoc ++ "/"