clearer message when direct mode upgrade fails

When a remote is being upgraded, the message looked as if the local
repo was where the problem was. So include the path of the repo.
This commit is contained in:
Joey Hess 2019-08-27 12:23:34 -04:00
parent bb18bbd426
commit 770b8ff926
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -149,13 +149,14 @@ ensureInitialized :: Annex ()
ensureInitialized = do ensureInitialized = do
getVersion >>= maybe needsinit checkUpgrade getVersion >>= maybe needsinit checkUpgrade
whenM isDirect $ whenM isDirect $
unlessM (upgrade True versionForAdjustedBranch) $ unlessM (catchBoolIO $ upgrade True versionForAdjustedBranch) $ do
giveup "Upgrading this direct mode repository failed, and direct mode is no longer supported." g <- Annex.gitRepo
giveup $ "Upgrading direct mode repository " ++ Git.repoDescribe g ++ " failed, and direct mode is no longer supported."
where where
needsinit = ifM Annex.Branch.hasSibling needsinit = ifM Annex.Branch.hasSibling
( initialize Nothing Nothing ( initialize Nothing Nothing
, giveup "First run: git-annex init" , giveup $ "First run: git-annex init"
) )
{- Checks if a repository is initialized. Does not check version for ugrade. -} {- Checks if a repository is initialized. Does not check version for ugrade. -}
isInitialized :: Annex Bool isInitialized :: Annex Bool