Merge "UploadPack: consume delimiter in object-info command"
This commit is contained in:
commit
a1fa0ee679
|
@ -2766,7 +2766,9 @@ public void testObjectInfo() throws Exception {
|
|||
TestV2Hook hook = new TestV2Hook();
|
||||
ByteArrayInputStream recvStream = uploadPackV2((UploadPack up) -> {
|
||||
up.setProtocolV2Hook(hook);
|
||||
}, "command=object-info\n", "size",
|
||||
}, "command=object-info\n",
|
||||
PacketLineIn.delimiter(),
|
||||
"size",
|
||||
"oid " + ObjectId.toString(blob1.getId()),
|
||||
"oid " + ObjectId.toString(blob2.getId()), PacketLineIn.end());
|
||||
PacketLineIn pckIn = new PacketLineIn(recvStream);
|
||||
|
|
|
@ -281,6 +281,12 @@ ObjectInfoRequest parseObjectInfoRequest(PacketLineIn pckIn)
|
|||
return builder.build();
|
||||
}
|
||||
|
||||
if (!PacketLineIn.isDelimiter(line)) {
|
||||
throw new PackProtocolException(MessageFormat
|
||||
.format(JGitText.get().unexpectedPacketLine, line));
|
||||
}
|
||||
|
||||
line = pckIn.readString();
|
||||
if (!line.equals("size")) { //$NON-NLS-1$
|
||||
throw new PackProtocolException(MessageFormat
|
||||
.format(JGitText.get().unexpectedPacketLine, line));
|
||||
|
|
Loading…
Reference in New Issue