summaryrefslogtreecommitdiff
path: root/Locations.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Locations.hs')
-rw-r--r--Locations.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/Locations.hs b/Locations.hs
index db97bbec7..36172d621 100644
--- a/Locations.hs
+++ b/Locations.hs
@@ -11,6 +11,7 @@ module Locations (
keyPaths,
keyPath,
gitAnnexLocation,
+ gitAnnexMapping,
annexLocations,
annexLocation,
gitAnnexDir,
@@ -107,6 +108,13 @@ 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"
+
{- The annex directory of a repository. -}
gitAnnexDir :: Git.Repo -> FilePath
gitAnnexDir r = addTrailingPathSeparator $ Git.localGitDir r </> annexDir