--- a/hgext/remotefilelog/shallowutil.py Wed Jul 07 11:45:17 2021 -0400
+++ b/hgext/remotefilelog/shallowutil.py Wed Jul 07 11:47:02 2021 -0400
@@ -247,6 +247,11 @@
size = None
try:
index = raw.index(b'\0')
+ except ValueError:
+ raise BadRemotefilelogHeader(
+ "unexpected remotefilelog header: illegal format"
+ )
+ if True:
header = raw[:index]
if header.startswith(b'v'):
# v1 and above, header starts with 'v'
@@ -263,10 +268,6 @@
else:
# v0, str(int(size)) is the header
size = int(header)
- except ValueError:
- raise BadRemotefilelogHeader(
- "unexpected remotefilelog header: illegal format"
- )
if size is None:
raise BadRemotefilelogHeader(
"unexpected remotefilelog header: no size found"