summaryrefslogtreecommitdiff
path: root/Locations.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-11-08 15:14:54 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-11-08 15:14:54 -0400
commit02a21d7f274568a2e2f94498607955aab8713a24 (patch)
tree5c53164ff6f3c10c1704a0d36772aac3e8a5f40a /Locations.hs
parentab4de454914954676aa1e05ef26dc8a85bd8f6f1 (diff)
reorg .git/annex
Diffstat (limited to 'Locations.hs')
-rw-r--r--Locations.hs13
1 files changed, 10 insertions, 3 deletions
diff --git a/Locations.hs b/Locations.hs
index 951924c40..78c0bff4b 100644
--- a/Locations.hs
+++ b/Locations.hs
@@ -13,7 +13,8 @@ module Locations (
annexLocation,
annexLocationRelative,
annexTmpLocation,
- annexDir
+ annexDir,
+ annexObjectDir
) where
import Data.String.Utils
@@ -29,7 +30,7 @@ gitStateDir :: Git.Repo -> FilePath
gitStateDir repo = (Git.workTree repo) ++ "/" ++ stateLoc
{- An annexed file's content is stored in
- - /path/to/repo/.git/annex/<key>, where <key> is of the form
+ - /path/to/repo/.git/annex/objects/<key>/<key>, where <key> is of the form
- <backend:fragment>
-
- That allows deriving the key and backend by looking at the symlink to it.
@@ -42,7 +43,8 @@ annexLocation r key =
-
- Note: Assumes repo is NOT bare.-}
annexLocationRelative :: Key -> FilePath
-annexLocationRelative key = ".git/annex/" ++ (keyFile key)
+annexLocationRelative key = ".git/annex/objects/" ++ f ++ f
+ where f = keyFile key
{- The annex directory of a repository.
-
@@ -50,6 +52,11 @@ annexLocationRelative key = ".git/annex/" ++ (keyFile key)
annexDir :: Git.Repo -> FilePath
annexDir r = Git.workTree r ++ "/.git/annex"
+{- The part of the annex directory where file contents are stored.
+ -}
+annexObjectDir :: Git.Repo -> FilePath
+annexObjectDir r = annexDir r ++ "/objects"
+
{- .git-annex/tmp is used for temp files -}
annexTmpLocation :: Git.Repo -> FilePath
annexTmpLocation r = annexDir r ++ "/tmp/"