summaryrefslogtreecommitdiff
path: root/Upgrade
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-06-23 08:48:13 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-06-23 08:48:13 -0400
commit9e37898e2186c8f7bb71a5d2bd7a02303410b363 (patch)
treea964c45d443c3ecaa6dea61b48caa996b8b3552b /Upgrade
parentaf10b2854a199ed9985cde938d46b252f4d5e503 (diff)
remove stateDir
Diffstat (limited to 'Upgrade')
-rw-r--r--Upgrade/V1.hs6
-rw-r--r--Upgrade/V2.hs6
2 files changed, 9 insertions, 3 deletions
diff --git a/Upgrade/V1.hs b/Upgrade/V1.hs
index 61a801859..b06f00d34 100644
--- a/Upgrade/V1.hs
+++ b/Upgrade/V1.hs
@@ -113,7 +113,7 @@ moveLocationLogs = do
where
oldlocationlogs = do
g <- Annex.gitRepo
- let dir = gitStateDir g
+ let dir = Upgrade.V2.gitStateDir g
exists <- liftIO $ doesDirectoryExist dir
if exists
then do
@@ -123,7 +123,7 @@ moveLocationLogs = do
move (l, k) = do
g <- Annex.gitRepo
let dest = logFile k
- let dir = gitStateDir g
+ let dir = Upgrade.V2.gitStateDir g
let f = dir </> l
liftIO $ createDirectoryIfMissing True (parentDir dest)
-- could just git mv, but this way deals with
@@ -186,7 +186,7 @@ fileKey1 file = readKey1 $
replace "&a" "&" $ replace "&s" "%" $ replace "%" "/" file
logFile1 :: Git.Repo -> Key -> String
-logFile1 repo key = gitStateDir repo ++ keyFile1 key ++ ".log"
+logFile1 repo key = Upgrade.V2.gitStateDir repo ++ keyFile1 key ++ ".log"
lookupFile1 :: FilePath -> Annex (Maybe (Key, Backend Annex))
lookupFile1 file = do
diff --git a/Upgrade/V2.hs b/Upgrade/V2.hs
index 36ba1a0f2..7e4cfb13a 100644
--- a/Upgrade/V2.hs
+++ b/Upgrade/V2.hs
@@ -89,3 +89,9 @@ gitAttributesUnWrite repo = do
liftIO $ safeWriteFile attributes $ unlines $
filter (\l -> not $ l `elem` attrLines) $ lines c
Git.run repo "add" [File attributes]
+
+stateDir :: FilePath
+stateDir = addTrailingPathSeparator $ ".git-annex"
+gitStateDir :: Git.Repo -> FilePath
+gitStateDir repo = addTrailingPathSeparator $ Git.workTree repo </> stateDir
+