reftable: increment pointer *after* reading uint16
This fixes timezone reads out of the reflog. Change-Id: I126d8742e5e904a074c544514180720466164f7c Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
This commit is contained in:
parent
81801d6f96
commit
d7ee5aafee
|
@ -624,6 +624,8 @@ public void onlyReflog() throws IOException {
|
||||||
assertEquals(ObjectId.zeroId(), lc.getReflogEntry().getOldId());
|
assertEquals(ObjectId.zeroId(), lc.getReflogEntry().getOldId());
|
||||||
assertEquals(id(1), lc.getReflogEntry().getNewId());
|
assertEquals(id(1), lc.getReflogEntry().getNewId());
|
||||||
assertEquals(who, lc.getReflogEntry().getWho());
|
assertEquals(who, lc.getReflogEntry().getWho());
|
||||||
|
// compare string too, to catch tz differences.
|
||||||
|
assertEquals(who.toExternalString(), lc.getReflogEntry().getWho().toExternalString());
|
||||||
assertEquals(msg, lc.getReflogEntry().getComment());
|
assertEquals(msg, lc.getReflogEntry().getComment());
|
||||||
|
|
||||||
assertTrue(lc.next());
|
assertTrue(lc.next());
|
||||||
|
|
|
@ -557,7 +557,9 @@ private void skipString() {
|
||||||
}
|
}
|
||||||
|
|
||||||
private short readInt16() {
|
private short readInt16() {
|
||||||
return (short) NB.decodeUInt16(buf, ptr += 2);
|
short result =(short) NB.decodeUInt16(buf, ptr);
|
||||||
|
ptr += 2;
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private int readVarint32() {
|
private int readVarint32() {
|
||||||
|
|
Loading…
Reference in New Issue