diff options
author | Joey Hess <joey@kitenet.net> | 2011-03-19 14:46:44 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-03-19 14:46:44 -0400 |
commit | 43b3675d4298ffe8cfaefed0d70f0ef1fce25e37 (patch) | |
tree | 86279d7465d8dd33a9d52d50149a13e18eaa866e /Upgrade/V1.hs | |
parent | 1de3cbbef101e1499c27aa3c600946a2c8472b05 (diff) |
don't crash on upgrade if .git-annex DNE
Diffstat (limited to 'Upgrade/V1.hs')
-rw-r--r-- | Upgrade/V1.hs | 8 |
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 |