upgrade: When upgrade fails due to an exception, display it.
37b42e72e7
made it catch exceptions but
thought they were unlikely to be useful to display, which may be right when
a git command fails, but not in the case yoh found.
This commit is contained in:
parent
5eb101b720
commit
bb88a01910
3 changed files with 7 additions and 2 deletions
|
@ -9,6 +9,7 @@ git-annex (8.20200502) UNRELEASED; urgency=medium
|
|||
* repair: Improve fetching from a remote with an url in host:path format.
|
||||
* sync: Avoid an ugly error message when nothing has been committed to
|
||||
master yet and there is a synced master branch to merge from.
|
||||
* upgrade: When upgrade fails due to an exception, display it.
|
||||
|
||||
-- Joey Hess <id@joeyh.name> Mon, 04 May 2020 12:46:11 -0400
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ import Annex.AdjustedBranch
|
|||
import qualified Data.ByteString as S
|
||||
|
||||
upgrade :: Bool -> Annex Bool
|
||||
upgrade automatic = flip catchNonAsync (const $ return False) $ do
|
||||
upgrade automatic = flip catchNonAsync onexception $ do
|
||||
unless automatic $
|
||||
showAction "v5 to v6"
|
||||
ifM isDirect
|
||||
|
@ -55,6 +55,10 @@ upgrade automatic = flip catchNonAsync (const $ return False) $ do
|
|||
unlessM isDirect $
|
||||
createInodeSentinalFile True
|
||||
return True
|
||||
where
|
||||
onexception e = do
|
||||
warning $ "caught exception: " ++ show e
|
||||
return False
|
||||
|
||||
-- git before 2.22 would OOM running git status on a large file.
|
||||
--
|
||||
|
|
|
@ -150,4 +150,4 @@ So it seems git-annex should revert back to reporting errors from underlying `gi
|
|||
[[!meta author=yoh]]
|
||||
[[!tag projects/datalad]]
|
||||
|
||||
|
||||
> [[fixed|done]], thanks for tracking it back to the root cause. --[[Joey]]
|
||||
|
|
Loading…
Reference in a new issue