When processing a fetch using protocol v2, UploadPack#fetchV2 sends an
extraneous flush pkt when also sending a packfile (#sendPack sending its
own flush pkt). Update that method to only send the flush pkt if the
packfile is not being sent.
Change-Id: I7117a264bccd2d7f3a048645fcb8425a9d78d526
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
new StringWriter(), NullOutputStream.INSTANCE);
PackParser pp = client.newObjectInserter().newPackParser(sb);
pp.parse(NullProgressMonitor.INSTANCE);
+
+ // Ensure that there is nothing left in the stream.
+ assertThat(recvStream.read(), is(-1));
+
return pp.getReceivedPackStatistics();
}
? db.getRefDatabase().getRefsByPrefix(R_TAGS)
: null,
unshallowCommits);
+ // sendPack invokes pckOut.end() for us, so we do not
+ // need to invoke it here.
+ } else {
+ // Invoke pckOut.end() by ourselves.
+ pckOut.end();
}
- pckOut.end();
}
/*