summaryrefslogtreecommitdiff
path: root/Upgrade
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-03-19 14:46:44 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-03-19 14:46:44 -0400
commit43b3675d4298ffe8cfaefed0d70f0ef1fce25e37 (patch)
tree86279d7465d8dd33a9d52d50149a13e18eaa866e /Upgrade
parent1de3cbbef101e1499c27aa3c600946a2c8472b05 (diff)
don't crash on upgrade if .git-annex DNE
Diffstat (limited to 'Upgrade')
-rw-r--r--Upgrade/V1.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/Upgrade/V1.hs b/Upgrade/V1.hs
index 270de5f74..43f279ad0 100644
--- a/Upgrade/V1.hs
+++ b/Upgrade/V1.hs
@@ -115,8 +115,12 @@ moveLocationLogs = do
oldlocationlogs = do
g <- Annex.gitRepo
let dir = gitStateDir g
- contents <- liftIO $ getDirectoryContents dir
- return $ catMaybes $ map oldlog2key contents
+ exists <- liftIO $ doesDirectoryExist dir
+ if exists
+ then do
+ contents <- liftIO $ getDirectoryContents dir
+ return $ catMaybes $ map oldlog2key contents
+ else return []
move (l, k) = do
g <- Annex.gitRepo
let dest = logFile g k