diff options
author | Colby Ranger <cranger@google.com> | 2013-08-05 14:33:55 -0700 |
---|---|---|
committer | Colby Ranger <cranger@google.com> | 2013-08-05 14:56:17 -0700 |
commit | 69761dbcdd38791151c4fdd76c05c366cc3f7a68 (patch) | |
tree | a1dab063e0cca8b3e3500cabd96e58a4968aab6d | |
parent | ffb2600dd59e5364ceec662383903574a85a2f78 (diff) | |
download | jgit-69761dbcdd38791151c4fdd76c05c366cc3f7a68.tar.gz jgit-69761dbcdd38791151c4fdd76c05c366cc3f7a68.zip |
Send no-progress option with NullProgressMonitor.
The NullProgressMonitor does not report progress anywhere. Inform the
server not to send progress by enabling the no-progress capability.
Change-Id: Id18dbc754c814d1a5534a284c947030bf201c569
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackFetchConnection.java | 11 |
1 files changed, 10 insertions, 1 deletions
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 7a30d251ad..f49028e37b 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackFetchConnection.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackFetchConnection.java @@ -63,6 +63,7 @@ import org.eclipse.jgit.lib.Config; import org.eclipse.jgit.lib.Config.SectionParser; import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.MutableObjectId; +import org.eclipse.jgit.lib.NullProgressMonitor; import org.eclipse.jgit.lib.ObjectId; import org.eclipse.jgit.lib.ObjectInserter; import org.eclipse.jgit.lib.ProgressMonitor; @@ -221,6 +222,8 @@ public abstract class BasePackFetchConnection extends BasePackConnection private boolean noDone; + private boolean noProgress; + private String lockMessage; private PackLock packLock; @@ -320,7 +323,9 @@ public abstract class BasePackFetchConnection extends BasePackConnection * Execute common ancestor negotiation and fetch the objects. * * @param monitor - * progress monitor to receive status updates. + * progress monitor to receive status updates. If the monitor is + * the {@link NullProgressMonitor#INSTANCE}, then the no-progress + * option enabled. * @param want * the advertised remote references the caller wants to fetch. * @param have @@ -337,6 +342,8 @@ public abstract class BasePackFetchConnection extends BasePackConnection final Collection<Ref> want, final Set<ObjectId> have, OutputStream outputStream) throws TransportException { try { + noProgress = monitor == NullProgressMonitor.INSTANCE; + markRefsAdvertised(); markReachable(have, maxTimeWanted(want)); @@ -480,6 +487,8 @@ public abstract class BasePackFetchConnection extends BasePackConnection private String enableCapabilities() throws TransportException { final StringBuilder line = new StringBuilder(); + if (noProgress) + wantCapability(line, OPTION_NO_PROGRESS); if (includeTags) includeTags = wantCapability(line, OPTION_INCLUDE_TAG); if (allowOfsDelta) |