Merge "Improve native Git transport when following repository"
This commit is contained in:
commit
8aef29c114
|
@ -434,12 +434,13 @@ private void negotiate(final ProgressMonitor monitor) throws IOException,
|
||||||
int havesSinceLastContinue = 0;
|
int havesSinceLastContinue = 0;
|
||||||
boolean receivedContinue = false;
|
boolean receivedContinue = false;
|
||||||
boolean receivedAck = false;
|
boolean receivedAck = false;
|
||||||
|
boolean negotiate = true;
|
||||||
|
|
||||||
if (statelessRPC)
|
if (statelessRPC)
|
||||||
state.writeTo(out, null);
|
state.writeTo(out, null);
|
||||||
|
|
||||||
negotiateBegin();
|
negotiateBegin();
|
||||||
SEND_HAVES: for (;;) {
|
SEND_HAVES: while (negotiate) {
|
||||||
final RevCommit c = walk.next();
|
final RevCommit c = walk.next();
|
||||||
if (c == null)
|
if (c == null)
|
||||||
break SEND_HAVES;
|
break SEND_HAVES;
|
||||||
|
@ -505,6 +506,8 @@ private void negotiate(final ProgressMonitor monitor) throws IOException,
|
||||||
receivedAck = true;
|
receivedAck = true;
|
||||||
receivedContinue = true;
|
receivedContinue = true;
|
||||||
havesSinceLastContinue = 0;
|
havesSinceLastContinue = 0;
|
||||||
|
if (anr == AckNackResult.ACK_READY)
|
||||||
|
negotiate = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -591,9 +591,11 @@ private ObjectId processHaveLines(List<ObjectId> peerHas, ObjectId last)
|
||||||
// create a pack at this point, let the client know so it stops
|
// create a pack at this point, let the client know so it stops
|
||||||
// telling us about its history.
|
// telling us about its history.
|
||||||
//
|
//
|
||||||
|
boolean didOkToGiveUp = false;
|
||||||
for (int i = peerHas.size() - 1; i >= 0; i--) {
|
for (int i = peerHas.size() - 1; i >= 0; i--) {
|
||||||
ObjectId id = peerHas.get(i);
|
ObjectId id = peerHas.get(i);
|
||||||
if (walk.lookupOrNull(id) == null) {
|
if (walk.lookupOrNull(id) == null) {
|
||||||
|
didOkToGiveUp = true;
|
||||||
if (okToGiveUp()) {
|
if (okToGiveUp()) {
|
||||||
switch (multiAck) {
|
switch (multiAck) {
|
||||||
case OFF:
|
case OFF:
|
||||||
|
@ -610,6 +612,11 @@ private ObjectId processHaveLines(List<ObjectId> peerHas, ObjectId last)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (multiAck == MultiAck.DETAILED && !didOkToGiveUp && okToGiveUp()) {
|
||||||
|
ObjectId id = peerHas.get(peerHas.size() - 1);
|
||||||
|
pckOut.writeString("ACK " + id.name() + " ready\n");
|
||||||
|
}
|
||||||
|
|
||||||
peerHas.clear();
|
peerHas.clear();
|
||||||
return last;
|
return last;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue