Show More
@@ -58,14 +58,16 b' def _parse(data):' | |||||
58 | prev = l |
|
58 | prev = l | |
59 | f, n = l.split(b'\0') |
|
59 | f, n = l.split(b'\0') | |
60 | nl = len(n) |
|
60 | nl = len(n) | |
61 |
|
|
61 | flags = n[-1:] | |
62 | # modern hash, full width |
|
62 | if flags in _manifestflags: | |
63 | yield f, bin(n[:64]), n[64:] |
|
63 | n = n[:-1] | |
64 |
|
|
64 | nl -= 1 | |
65 | # legacy hash, always sha1 |
|
|||
66 | yield f, bin(n[:40]), n[40:] |
|
|||
67 | else: |
|
65 | else: | |
68 |
|
|
66 | flags = b'' | |
|
67 | if nl not in (40, 64): | |||
|
68 | raise ValueError(b'Invalid manifest line') | |||
|
69 | ||||
|
70 | yield f, bin(n), flags | |||
69 |
|
71 | |||
70 |
|
72 | |||
71 | def _text(it): |
|
73 | def _text(it): |
General Comments 0
You need to be logged in to leave comments.
Login now