This instance will be upgraded to Heptapod 0.26.0rc1 on 2021-10-25 at 14:00 UTC+2 (a few minutes of down time)

Commit 8d851863 authored by Dan Villiom Podlaski Christiansen's avatar Dan Villiom Podlaski Christiansen
Browse files

gverify: handle corruption gracefully

parent 6079145717c4
Pipeline #22662 passed with stages
in 9 minutes and 49 seconds
......@@ -38,6 +38,13 @@ def verify(ui, repo, hgctx):
except KeyError:
raise error.Abort(_(b'git equivalent %s for rev %s not found!') %
(gitsha, hgctx))
except Exception:
ui.traceback()
raise error.Abort(
_(b'git equivalent %s for rev %s is corrupt!') % (gitsha, hgctx),
hint=b're-run with --traceback for details',
)
if not isinstance(gitcommit, Commit):
raise error.Abort(_(b'git equivalent %s for rev %s is not a commit!') %
(gitsha, hgctx))
......
......@@ -81,3 +81,8 @@ corrupt git repository
$ hg gverify
abort: git equivalent 6dff77b710b6f0961ac0b6d91d85902195133d74 for rev 5c2eb98af3e2 is not a commit!
[255]
$ echo 42 > .hg/git/objects/6d/ff77b710b6f0961ac0b6d91d85902195133d74
$ hg gverify
abort: git equivalent 6dff77b710b6f0961ac0b6d91d85902195133d74 for rev 5c2eb98af3e2 is corrupt!
(re-run with --traceback for details)
[255]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment