1 parent 3936084 commit 1ef4552Copy full SHA for 1ef4552
git/refs/log.py
@@ -80,11 +80,15 @@ def from_line(cls, line):
80
""":return: New RefLogEntry instance from the given revlog line.
81
:param line: line without trailing newline
82
:raise ValueError: If line could not be parsed"""
83
- try:
84
- info, msg = line.split('\t', 2)
85
- except ValueError:
86
- raise ValueError("line is missing tab separator")
87
- # END handle first plit
+ fields = line.split('\t', 1)
+ if len(fields) == 1:
+ info, msg = fields[0], None
+ elif len(fields) == 2:
+ info, msg = fields
88
+ else:
89
+ raise ValueError("Line must have up to two TAB-separated fields."
90
+ " Got %s" % repr(line))
91
+ # END handle first split
92
oldhexsha = info[:40]
93
newhexsha = info[41:81]
94
for hexsha in (oldhexsha, newhexsha):
0 commit comments