diff options
author | Joey Hess <joey@kitenet.net> | 2010-10-13 00:42:46 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2010-10-13 00:42:46 -0400 |
commit | 208bba8d3062133733d27a5db521013e3a2ead57 (patch) | |
tree | 0a54c5cc7899329a13f995b57f32d25dceb17016 /Locations.hs | |
parent | 9926fe5c8a1479f734c0a5b68c7c4e6ddfc2f8cf (diff) |
got rid of the .git-annex/key.backend files
Diffstat (limited to 'Locations.hs')
-rw-r--r-- | Locations.hs | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/Locations.hs b/Locations.hs index c12b9fadc..b859fd2f2 100644 --- a/Locations.hs +++ b/Locations.hs @@ -5,8 +5,7 @@ module Locations ( gitStateDir, stateLoc, keyFile, - annexLocation, - backendFile + annexLocation ) where import Data.String.Utils @@ -25,15 +24,10 @@ gitStateDir repo = (gitWorkTree repo) ++ "/" ++ stateLoc ++ "/" keyFile :: Key -> FilePath keyFile key = replace "/" "&s" $ replace "&" "&a" key -{- An annexed file's content is stored somewhere under .git/annex/, - - based on the key. -} -annexLocation :: State -> Key -> FilePath -annexLocation state key = gitDir (repo state) ++ "/annex/" ++ (keyFile key) - -{- The mapping from filename to its key is stored in the .git-annex directory, - - in a file named `key/$filename.$backend` -} -backendFile :: State -> Backend -> FilePath -> String -backendFile state backend file = - gitStateDir (repo state) ++ "key/" ++ - (gitRelative (repo state) file) ++ - "." ++ (name backend) +{- An annexed file's content is stored in + - .git/annex/<backend>/<key> ; this allows deriving the key and backend + - by looking at the symlink to it. -} +annexLocation :: State -> Backend -> Key -> FilePath +annexLocation state backend key = + gitDir (repo state) ++ "/annex/" ++ (name backend) ++ + "/" ++ (keyFile key) |