Browse Source

Merge "Improve native Git transport when following repository"

stable-0.12
Chris Aniszczyk 14 years ago committed by Code Review
parent
commit
8aef29c114
  1. 5
      org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackFetchConnection.java
  2. 7
      org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java

5
org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackFetchConnection.java

@ -434,12 +434,13 @@ public abstract class BasePackFetchConnection extends BasePackConnection
int havesSinceLastContinue = 0;
boolean receivedContinue = false;
boolean receivedAck = false;
boolean negotiate = true;
if (statelessRPC)
state.writeTo(out, null);
negotiateBegin();
SEND_HAVES: for (;;) {
SEND_HAVES: while (negotiate) {
final RevCommit c = walk.next();
if (c == null)
break SEND_HAVES;
@ -505,6 +506,8 @@ public abstract class BasePackFetchConnection extends BasePackConnection
receivedAck = true;
receivedContinue = true;
havesSinceLastContinue = 0;
if (anr == AckNackResult.ACK_READY)
negotiate = false;
break;
}

7
org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java

@ -591,9 +591,11 @@ public class UploadPack {
// create a pack at this point, let the client know so it stops
// telling us about its history.
//
boolean didOkToGiveUp = false;
for (int i = peerHas.size() - 1; i >= 0; i--) {
ObjectId id = peerHas.get(i);
if (walk.lookupOrNull(id) == null) {
didOkToGiveUp = true;
if (okToGiveUp()) {
switch (multiAck) {
case OFF:
@ -610,6 +612,11 @@ public class UploadPack {
}
}
if (multiAck == MultiAck.DETAILED && !didOkToGiveUp && okToGiveUp()) {
ObjectId id = peerHas.get(peerHas.size() - 1);
pckOut.writeString("ACK " + id.name() + " ready\n");
}
peerHas.clear();
return last;
}

Loading…
Cancel
Save