summaryrefslogtreecommitdiff
path: root/Locations.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Locations.hs')
-rw-r--r--Locations.hs17
1 files changed, 17 insertions, 0 deletions
diff --git a/Locations.hs b/Locations.hs
index db97bbec7..cfe9bd27d 100644
--- a/Locations.hs
+++ b/Locations.hs
@@ -11,6 +11,8 @@ module Locations (
keyPaths,
keyPath,
gitAnnexLocation,
+ gitAnnexMapping,
+ gitAnnexCache,
annexLocations,
annexLocation,
gitAnnexDir,
@@ -107,6 +109,21 @@ gitAnnexLocation key r
check locs@(l:_) = fromMaybe l <$> firstM doesFileExist locs
check [] = error "internal"
+{- File that maps from a key to the file(s) in the git repository.
+ - Used in direct mode. -}
+gitAnnexMapping :: Key -> Git.Repo -> IO FilePath
+gitAnnexMapping key r = do
+ loc <- gitAnnexLocation key r
+ return $ loc ++ ".map"
+
+{- File that caches information about a key's content, used to determine
+ - if a file has changed.
+ - Used in direct mode. -}
+gitAnnexCache :: Key -> Git.Repo -> IO FilePath
+gitAnnexCache key r = do
+ loc <- gitAnnexLocation key r
+ return $ loc ++ ".cache"
+
{- The annex directory of a repository. -}
gitAnnexDir :: Git.Repo -> FilePath
gitAnnexDir r = addTrailingPathSeparator $ Git.localGitDir r </> annexDir