Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1ef4552

Browse files
committed
BF: allow log line to have no msg (Closegitpython-developers#225)
1 parent3936084 commit1ef4552

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-
exceptValueError:
86-
raiseValueError("line is missing tab separator")
87-
# END handle first plit
83+
fields=line.split('\t',1)
84+
iflen(fields)==1:
85+
info,msg=fields[0],None
86+
eliflen(fields)==2:
87+
info,msg=fields
88+
else:
89+
raiseValueError("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
forhexshain (oldhexsha,newhexsha):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp