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.
|
* 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
|
* sync: Avoid an ugly error message when nothing has been committed to
|
||||||
master yet and there is a synced master branch to merge from.
|
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
|
-- 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
|
import qualified Data.ByteString as S
|
||||||
|
|
||||||
upgrade :: Bool -> Annex Bool
|
upgrade :: Bool -> Annex Bool
|
||||||
upgrade automatic = flip catchNonAsync (const $ return False) $ do
|
upgrade automatic = flip catchNonAsync onexception $ do
|
||||||
unless automatic $
|
unless automatic $
|
||||||
showAction "v5 to v6"
|
showAction "v5 to v6"
|
||||||
ifM isDirect
|
ifM isDirect
|
||||||
|
@ -55,6 +55,10 @@ upgrade automatic = flip catchNonAsync (const $ return False) $ do
|
||||||
unlessM isDirect $
|
unlessM isDirect $
|
||||||
createInodeSentinalFile True
|
createInodeSentinalFile True
|
||||||
return 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.
|
-- 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]]
|
[[!meta author=yoh]]
|
||||||
[[!tag projects/datalad]]
|
[[!tag projects/datalad]]
|
||||||
|
|
||||||
|
> [[fixed|done]], thanks for tracking it back to the root cause. --[[Joey]]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue