GitPython log()错误

时间:2016-09-20 09:48:24

标签: gitpython

我的方法log()

有问题
repo = git.Repo(repo_path)

branch = repo.head
log = branch.log()

print log

错误:

 Traceback (most recent call last):            File "gitpython.py",
 line 29, in <module          log = branch.log()        File
 "/usr/local/lib/python2.7/dist-packages/GitPython-2.0.9dev0-py2.7.egg/git/refs/symbolic.py", line 361, in log    
     return RefLog.from_file(RefLog.path(self))             File "/usr/local/lib/python2.7/dist-packages/GitPython-2.0.9dev0-py2.7.egg/git/refs/log.py",
 line 179, in from_file        
     return cls(filepath)             File "/usr/local/lib/python2.7/dist-packages/GitPython-2.0.9dev0-py2.7.egg/git/refs/log.py",
 line 153, in __init__         
     self._read_from_file()            File "/usr/local/lib/python2.7/dist-packages/GitPython-2.0.9dev0-py2.7.egg/git/refs/log.py",
 line 165, in _read_from_file         
     self._deserialize(fmap)           File "/usr/local/lib/python2.7/dist-packages/GitPython-2.0.9dev0-py2.7.egg/git/refs/log.py",
 line 318, in _deserialize         
     self.extend(self.iter_entries(stream))           File "/usr/local/lib/python2.7/dist-packages/GitPython-2.0.9dev0-py2.7.egg/git/refs/log.py",
 line 205, in iter_entries       
     yield new_entry(line.strip())            File "/usr/local/lib/python2.7/dist-packages/GitPython-2.0.9dev0-py2.7.egg/git/refs/log.py",
 line 123, in from_line        
     raise ValueError("Missing token: >")        ValueError: Missing token: >

1 个答案:

答案 0 :(得分:0)

你有没有更新gitpython?

File "/usr/local/lib/python2.7/dist-packages/GitPython-2.0.9dev0-py2.7.egg/git/refs/log.py",
line 123, in from_line        
raise ValueError("Missing token: >")        ValueError: Missing token: >

似乎在log.py文件中指出错误。