浏览代码

Do not crash when trying to walk an empty set

Benjamin Pollack 12 年之前
父节点
当前提交
9295c69eaa
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      dulwich/walk.py

+ 1 - 1
dulwich/walk.py

@@ -153,7 +153,7 @@ class _CommitTimeQueue(object):
                 if self._pq and all(c.id in self._excluded
                 if self._pq and all(c.id in self._excluded
                                     for _, c in self._pq):
                                     for _, c in self._pq):
                     _, n = self._pq[0]
                     _, n = self._pq[0]
-                    if n.commit_time >= self._last.commit_time:
+                    if self._last and n.commit_time >= self._last.commit_time:
                         # If the next commit is newer than the last one, we need
                         # If the next commit is newer than the last one, we need
                         # to keep walking in case its parents (which we may not
                         # to keep walking in case its parents (which we may not
                         # have seen yet) are excluded. This gives the excluded
                         # have seen yet) are excluded. This gives the excluded