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