diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackFetchConnection.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackFetchConnection.java index 2c9761a25..4a86da7c6 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackFetchConnection.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackFetchConnection.java @@ -455,7 +455,7 @@ public abstract class BasePackFetchConnection extends BasePackConnection state.writeTo(out, null); negotiateBegin(); - SEND_HAVES: while (!receivedReady) { + SEND_HAVES: for (;;) { final RevCommit c = walk.next(); if (c == null) break SEND_HAVES; @@ -530,6 +530,8 @@ public abstract class BasePackFetchConnection extends BasePackConnection throw new CancelledException(); } + if (noDone & receivedReady) + break SEND_HAVES; if (statelessRPC) state.writeTo(out, null);