PacketLineIn.END);
PacketLineIn pckIn = new PacketLineIn(recvStream);
- // wanted-refs appears first, then shallow-info.
- assertThat(pckIn.readString(), is("wanted-refs"));
- assertThat(pckIn.readString(), is(child.toObjectId().getName() + " refs/heads/branch1"));
- assertThat(pckIn.readString(), theInstance(PacketLineIn.DELIM));
+ // shallow-info appears first, then wanted-refs.
assertThat(pckIn.readString(), is("shallow-info"));
assertThat(pckIn.readString(), is("shallow " + child.toObjectId().getName()));
assertThat(pckIn.readString(), theInstance(PacketLineIn.DELIM));
+ assertThat(pckIn.readString(), is("wanted-refs"));
+ assertThat(pckIn.readString(), is(child.toObjectId().getName() + " refs/heads/branch1"));
+ assertThat(pckIn.readString(), theInstance(PacketLineIn.DELIM));
assertThat(pckIn.readString(), is("packfile"));
parsePack(recvStream);
assertTrue(client.hasObject(child.toObjectId()));
}
if (doneReceived || okToGiveUp()) {
- if (!wantedRefs.isEmpty()) {
- if (sectionSent) {
- pckOut.writeDelim();
- }
- pckOut.writeString("wanted-refs\n"); //$NON-NLS-1$
- for (Map.Entry<String, ObjectId> entry : wantedRefs.entrySet()) {
- pckOut.writeString(entry.getValue().getName() + ' ' +
- entry.getKey() + '\n');
- }
- sectionSent = true;
- }
-
if (shallowCommits != null) {
if (sectionSent)
pckOut.writeDelim();
sectionSent = true;
}
+ if (!wantedRefs.isEmpty()) {
+ if (sectionSent) {
+ pckOut.writeDelim();
+ }
+ pckOut.writeString("wanted-refs\n"); //$NON-NLS-1$
+ for (Map.Entry<String, ObjectId> entry : wantedRefs.entrySet()) {
+ pckOut.writeString(entry.getValue().getName() + ' ' +
+ entry.getKey() + '\n');
+ }
+ sectionSent = true;
+ }
+
if (sectionSent)
pckOut.writeDelim();
pckOut.writeString("packfile\n"); //$NON-NLS-1$