convert GitRepo to struct with constructor
This commit is contained in:
parent
7880dc16fe
commit
dce9c2e080
7 changed files with 71 additions and 50 deletions
18
Locations.hs
Normal file
18
Locations.hs
Normal 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 ++ "/"
|
Loading…
Add table
Add a link
Reference in a new issue