don't crash on upgrade if .git-annex DNE

This commit is contained in:
Joey Hess 2011-03-19 14:46:44 -04:00
parent 1de3cbbef1
commit 43b3675d42

View file

@ -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