Commit 25229b31 authored by Chris McDonough's avatar Chris McDonough

If there was an "empty" transaction (one that did not modify any

objects), read_index would fail when trying to get the max of the
nonexistent oids in the transaction.
parent 4febdde3
......@@ -115,7 +115,7 @@
# may have a back pointer to a version record or to a non-version
# record.
#
__version__='$Revision: 1.90 $'[11:-2]
__version__='$Revision: 1.91 $'[11:-2]
import struct, time, os, string, base64, sys
from struct import pack, unpack
......@@ -2120,10 +2120,10 @@ def read_index(file, name, index, vindex, tindex, stop='\377'*8,
name, pos)
pos=pos+8
if tindex: # avoid the pathological empty transaction case
_maxoid = max(tindex.keys()) # in 2.2, just max(tindex)
maxoid = max(_maxoid, maxoid)
index.update(tindex)
tindex.clear()
return pos, maxoid, ltid
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment