aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchV2Request.java
diff options
context:
space:
mode:
authorJonathan Nieder <jrn@google.com>2018-12-26 13:26:23 -0800
committerJonathan Nieder <jrn@google.com>2018-12-26 13:26:23 -0800
commitf909de5c44900cb89a92ebcb1923789ee4e8e100 (patch)
tree43638c8f95b11b35013e6357693289511a01e88c /org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchV2Request.java
parent3cb80a433df9d4d0a5eb8ac3d86f39dc9c8fc9d1 (diff)
parent53ab1188d50149a22b2589e6017aba259f77b10b (diff)
downloadjgit-f909de5c44900cb89a92ebcb1923789ee4e8e100.tar.gz
jgit-f909de5c44900cb89a92ebcb1923789ee4e8e100.zip
Merge branch 'stable-5.1' into stable-5.2
* stable-5.1: UploadPack: Avoid calling AdvertiseRefsHook twice Prepare 5.1.5-SNAPSHOT builds JGit v5.1.4.201812251853-r UploadPack: Filter refs used for want-ref resolution UploadPack: Defer want-ref resolution to after parsing Call AdvertiseRefsHook for protocol v2 Prepare 4.11.7-SNAPSHOT builds JGit v4.11.6.201812241910-r Prepare 4.9.9-SNAPSHOT builds JGit v4.9.8.201812241815-r UploadPack: Test filtering by AdvertiseRefsHook in stateless transports Prepare 4.7.8-SNAPSHOT builds JGit v4.7.7.201812240805-r Fix feature versions imported by feature org.eclipse.jgit.pgm Prepare 4.5.6-SNAPSHOT builds JGit v4.5.5.201812240535-r Call AdvertiseRefsHook before validating wants Change-Id: I5879df9b723a0dbf6a1eff89a34bbb269f3b773d Signed-off-by: Jonathan Nieder <jrn@google.com>
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchV2Request.java')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchV2Request.java16
1 files changed, 6 insertions, 10 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchV2Request.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchV2Request.java
index 8e36a109e9..ac6361cdeb 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchV2Request.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchV2Request.java
@@ -48,9 +48,7 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
-import java.util.Map;
import java.util.Set;
-import java.util.TreeMap;
import org.eclipse.jgit.annotations.NonNull;
import org.eclipse.jgit.annotations.Nullable;
@@ -67,7 +65,7 @@ import org.eclipse.jgit.lib.ObjectId;
public final class FetchV2Request extends FetchRequest {
private final List<ObjectId> peerHas;
- private final TreeMap<String, ObjectId> wantedRefs;
+ private final List<String> wantedRefs;
private final boolean doneReceived;
@@ -75,7 +73,7 @@ public final class FetchV2Request extends FetchRequest {
private final List<String> serverOptions;
FetchV2Request(@NonNull List<ObjectId> peerHas,
- @NonNull TreeMap<String, ObjectId> wantedRefs,
+ @NonNull List<String> wantedRefs,
@NonNull Set<ObjectId> wantIds,
@NonNull Set<ObjectId> clientShallowCommits, int deepenSince,
@NonNull List<String> deepenNotRefs, int depth,
@@ -102,7 +100,7 @@ public final class FetchV2Request extends FetchRequest {
* @return list of references received in "want-ref" lines
*/
@NonNull
- Map<String, ObjectId> getWantedRefs() {
+ List<String> getWantedRefs() {
return wantedRefs;
}
@@ -135,7 +133,7 @@ public final class FetchV2Request extends FetchRequest {
static final class Builder {
final List<ObjectId> peerHas = new ArrayList<>();
- final TreeMap<String, ObjectId> wantedRefs = new TreeMap<>();
+ final List<String> wantedRefs = new ArrayList<>();
final Set<ObjectId> wantIds = new HashSet<>();
@@ -176,12 +174,10 @@ public final class FetchV2Request extends FetchRequest {
*
* @param refName
* reference name
- * @param oid
- * object id the reference is pointing at
* @return this builder
*/
- Builder addWantedRef(String refName, ObjectId oid) {
- wantedRefs.put(refName, oid);
+ Builder addWantedRef(String refName) {
+ wantedRefs.add(refName);
return this;
}