summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-11-07 17:36:24 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-11-07 17:36:24 -0400
commit316264f3e8f6dbcbd2c3752566d7d754dbfe9994 (patch)
treea218c5ffeda435908c5e869b758ac482a4057947
parentea8ccaa3d5416044ca69e4a3dcb7b879aec0ff4c (diff)
add annexDir
-rw-r--r--Locations.hs11
1 files changed, 8 insertions, 3 deletions
diff --git a/Locations.hs b/Locations.hs
index a296f8d87..951924c40 100644
--- a/Locations.hs
+++ b/Locations.hs
@@ -12,7 +12,8 @@ module Locations (
fileKey,
annexLocation,
annexLocationRelative,
- annexTmpLocation
+ annexTmpLocation,
+ annexDir
) where
import Data.String.Utils
@@ -43,11 +44,15 @@ annexLocation r key =
annexLocationRelative :: Key -> FilePath
annexLocationRelative key = ".git/annex/" ++ (keyFile key)
-{- .git-annex/tmp is used for temp files
+{- The annex directory of a repository.
-
- Note: Assumes repo is NOT bare. -}
+annexDir :: Git.Repo -> FilePath
+annexDir r = Git.workTree r ++ "/.git/annex"
+
+{- .git-annex/tmp is used for temp files -}
annexTmpLocation :: Git.Repo -> FilePath
-annexTmpLocation r = (Git.workTree r) ++ "/.git/annex/tmp/"
+annexTmpLocation r = annexDir r ++ "/tmp/"
{- Converts a key into a filename fragment.
-