summaryrefslogtreecommitdiff
path: root/Locations.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Locations.hs')
-rw-r--r--Locations.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/Locations.hs b/Locations.hs
index b2624754e..d30ceb136 100644
--- a/Locations.hs
+++ b/Locations.hs
@@ -15,6 +15,7 @@ module Locations (
gitAnnexDir,
gitAnnexObjectDir,
gitAnnexTmpDir,
+ gitAnnexTmpLocation,
gitAnnexBadDir,
gitAnnexUnusedLog,
isLinkToAnnex,
@@ -83,6 +84,10 @@ gitAnnexObjectDir r = addTrailingPathSeparator $ Git.workTree r </> objectDir
gitAnnexTmpDir :: Git.Repo -> FilePath
gitAnnexTmpDir r = addTrailingPathSeparator $ gitAnnexDir r </> "tmp"
+{- The temp file to use for a given key. -}
+gitAnnexTmpLocation :: Git.Repo -> Key -> FilePath
+gitAnnexTmpLocation r key = gitAnnexTmpDir r </> keyFile key
+
{- .git-annex/bad/ is used for bad files found during fsck -}
gitAnnexBadDir :: Git.Repo -> FilePath
gitAnnexBadDir r = addTrailingPathSeparator $ gitAnnexDir r </> "bad"
@@ -93,7 +98,7 @@ gitAnnexUnusedLog r = gitAnnexDir r </> "unused"
{- Checks a symlink target to see if it appears to point to annexed content. -}
isLinkToAnnex :: FilePath -> Bool
-isLinkToAnnex s = isInfixOf ("/" ++ objectDir) s
+isLinkToAnnex s = ("/" ++ objectDir) `isInfixOf` s
{- Converts a key into a filename fragment.
-