import org.eclipse.jgit.errors.StoredObjectRepresentationNotAvailableException;
import org.eclipse.jgit.lib.AnyObjectId;
import org.eclipse.jgit.lib.AsyncObjectSizeQueue;
+import org.eclipse.jgit.lib.BatchingProgressMonitor;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.NullProgressMonitor;
import org.eclipse.jgit.lib.ObjectId;
if (writeMonitor == null)
writeMonitor = NullProgressMonitor.INSTANCE;
- if (reuseSupport != null && (
+ boolean needSearchForReuse = reuseSupport != null && (
reuseDeltas
|| config.isReuseObjects()
- || !cachedPacks.isEmpty()))
+ || !cachedPacks.isEmpty());
+
+ if (compressMonitor instanceof BatchingProgressMonitor) {
+ long delay = 1000;
+ if (needSearchForReuse && config.isDeltaCompress())
+ delay = 500;
+ ((BatchingProgressMonitor) compressMonitor).setDelayStart(
+ delay,
+ TimeUnit.MILLISECONDS);
+ }
+
+ if (needSearchForReuse)
searchForReuse(compressMonitor);
if (config.isDeltaCompress())
searchForDeltas(compressMonitor);