From: Matthias Sohn Date: Tue, 31 Jan 2023 23:59:32 +0000 (+0100) Subject: Merge branch 'stable-6.2' into stable-6.3 X-Git-Tag: v6.5.0.202302011120-m2~1^2^2^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=82e1362e07c5811af2f67d6d9d5ec626febfcf2c;p=jgit.git Merge branch 'stable-6.2' into stable-6.3 * stable-6.2: Shortcut during git fetch for avoiding looping through all local refs FetchCommand: fix fetchSubmodules to work on a Ref to a blob Silence API warnings introduced by I466dcde6 Allow the exclusions of refs prefixes from bitmap PackWriterBitmapPreparer: do not include annotated tags in bitmap BatchingProgressMonitor: avoid int overflow when computing percentage Speedup GC listing objects referenced from reflogs FileSnapshotTest: Add more MISSING_FILE coverage Change-Id: I2ff386d9a096277360e6c7bd5535b49984620fb3 --- 82e1362e07c5811af2f67d6d9d5ec626febfcf2c diff --cc org.eclipse.jgit/.settings/.api_filters index f0c98e4b70,3e62b565ff..e02f5de532 --- a/org.eclipse.jgit/.settings/.api_filters +++ b/org.eclipse.jgit/.settings/.api_filters @@@ -22,64 -28,40 +28,98 @@@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --cc org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchProcess.java index 28c3b6a0fa,bb58a7e33f..e0eb126440 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchProcess.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchProcess.java @@@ -387,13 -388,21 +388,21 @@@ class FetchProcess private boolean askForIsComplete() throws TransportException { try { try (ObjectWalk ow = new ObjectWalk(transport.local)) { - for (ObjectId want : askFor.keySet()) - ow.markStart(ow.parseAny(want)); - for (Ref ref : localRefs().values()) - ow.markUninteresting(ow.parseAny(ref.getObjectId())); - ow.checkConnectivity(); + boolean hasCommitObject = false; + for (ObjectId want : askFor.keySet()) { + RevObject obj = ow.parseAny(want); + ow.markStart(obj); + hasCommitObject |= obj.getType() == Constants.OBJ_COMMIT; + } + // Checking connectivity makes sense on commits only + if (hasCommitObject) { + for (Ref ref : localRefs().values()) { + ow.markUninteresting(ow.parseAny(ref.getObjectId())); + } + ow.checkConnectivity(); + } } - return true; + return transport.getDepth() == null; // if depth is set we need to request objects that are already available } catch (MissingObjectException e) { return false; } catch (IOException e) {