catch exceptions in upgrade

Exceptions due to eg, not being able to write to the repo are not very
useful. There tends to be an error message from git about permission
denied.
This commit is contained in:
Joey Hess 2019-08-27 12:32:44 -04:00
parent 3a0842d9f8
commit 37b42e72e7
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -32,12 +32,12 @@ import Annex.AdjustedBranch
import qualified Data.ByteString as S
upgrade :: Bool -> Annex Bool
upgrade automatic = do
upgrade automatic = flip catchNonAsync (const $ return False) $ do
unless automatic $
showAction "v5 to v6"
ifM isDirect
( do
convertDirect automatic
convertDirect
-- Worktree files are already populated, so don't
-- have this try to populate them again.
scanUnlockedFiles False
@ -52,8 +52,8 @@ upgrade automatic = do
createInodeSentinalFile True
return True
convertDirect :: Bool -> Annex ()
convertDirect automatic = do
convertDirect :: Annex ()
convertDirect = do
{- Direct mode makes the same tradeoff of using less disk
- space, with less preservation of old versions of files
- as does annex.thin. -}