Skip to content

Commit d46e3fe

Browse files
committed
Merge pull request gitpython-developers#226 from yarikoptic/bf-tab-log-lines
BF: allow log line to have no msg (Close gitpython-developers#225)
2 parents 3936084 + 1ef4552 commit d46e3fe

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

git/refs/log.py

Lines changed: 9 additions & 5 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy