Skip to content

Commit 1ef4552

Browse files
committed
BF: allow log line to have no msg (Close #225)
1 parent 3936084 commit 1ef4552

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

‎git/refs/log.py

+9-5
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,15 @@ def from_line(cls, line):
8080
""":return: New RefLogEntry instance from the given revlog line.
8181
:param line: line without trailing newline
8282
: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
83+
fields = line.split('\t', 1)
84+
if len(fields) == 1:
85+
info, msg = fields[0], None
86+
elif len(fields) == 2:
87+
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
8892
oldhexsha = info[:40]
8993
newhexsha = info[41:81]
9094
for hexsha in (oldhexsha, newhexsha):

0 commit comments

Comments
 (0)